Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted
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:.

share|improve this answer
    
That works! I'm new to PS... Is it possible to run remotely? –  makerofthings7 Oct 15 '11 at 14:26
    
@makerofthings7 Certainly... add -computername $RemoteName to the get-wmiobject command to get a remote machine's listing. –  sysadmin1138 Oct 15 '11 at 14:29
add comment

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.

script below

#############################################
#
# 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
        }
}
share|improve this answer
    
Welcome to Server Fault! Generally we like answers on the site to be able to stand on their own - Links are great, but if that link ever breaks the answer should have enough information to still be helpful. Please consider editing your answer to include more detail. See the FAQ for more info. –  slm Apr 21 '13 at 16:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.