Checking Disk Capacity Of Remote Servers

When working in a domain it is sometime useful to be able to quickly check the available space of a hard drive remotely.

This can be done using the following PowerShell command:


Get-WmiObject -Class win32_logicalDisk -ComputerName server01 | Select-Object pscomputername, deviceid, freespace, size


This will display the results in bytes which can be converted to a more reasonable number. We can pipe the above command and filter it:

Get-WmiObject -Class win32_logicalDisk -ComputerName server01 | Select-Object pscomputername, deviceid, freespace, size | Format-Table pscomputername,deviceid,@{label="Freespace(GB)";Expression={$_.freespace/1000000000 -as [int]}},size


The resulting freespace will now show in Gigabytes.


For more information on this please see the following link:

Disk Capacity