The size column tells me the capacity of the drive but not the amount of disk used.
How do I determine how much data is on a mount point in 2008 R2? Any GUI or powershell command is fine.
The size column tells me the capacity of the drive but not the amount of disk used.
How do I determine how much data is on a mount point in 2008 R2? Any GUI or powershell command is fine.
get-wmiobject Win32_volume |select Name,Capacity,Freespace
That'll get you a list of everything, including mount-points, and their capacities.
As for GUI, it's there just a bit hidden. When you go to properties on the mount point itself, there is a button on the first page that'll give you the disk-stats same as you would at the root of something like C:.
You could also take a look at this powershell script:
http://www.powershellcave.com/?p=25
It has proven to be very handy when monitoring lots of mountpoints.
#############################################
#
# POWERSHELLCAVE.COM
# NAME: Mountpoint Monitoring
# Author: Caveman
# Summary: returns returnstate number that identifies state, replace with
# any desired message you would like to have in your monitoring system.
#
# Version
# 19-02-2013 Initial version
# 20-02-2013 Production version 1.0
#############################################
$maxmount="10"$mediummount="15"$returnStateOK=0$returnStateWarning=1$returnStateCritical=2$returnStateUnknown=3$TotalGB= @{Name="Capacity(GB)";expression={[math]::round(($_.Capacity/1073741824),2)}}
$FreeGB= @{Name="FreeSpace(GB)";expression={[math]::round(($_.FreeSpace /1073741824),2)}}
$FreePerc= @{Name="Free";expression={[math]::round(((($_.FreeSpace /1073741824)/($_.Capacity /1073741824)) *100),0)}}
$volumes=Get-WmiObjectwin32_volume | Where-object {$_.DriveLetter -eq$null}
$points= @($volumes | Select SystemName, Label, $TotalGB, $FreeGB, $FreePerc)
foreach ($entryin$pionts){
if ($entry.Free -le$maxmount){
$message="System"+""+$entry.SystemName +""+" mountpoint "+$entry.label+""+"has"+""+$entry.Free +"%"+" free space available"Write-Host$message
exit $returnStateCritical
}
elseif ($entry.Free -le$mediummount){
$message="System"+""+$entry.SystemName +""+" mountpoint "+$entry.label+""+"has"+""+$entry.Free +"%"+" free space available"Write-Host$message
exit $returnStateWarning
}
else {
Write-Host"OK"
exit $returnStateOK
}
}