Find Free Disk Space for a drive from a list of Servers

In order to get free disk space details for C: Drive of a list of Servers, execute below PS command.

Get-WmiObject -Class Win32_LogicalDisk -ComputerName (Get-Content C:\temp\Servers.txt) -Filter “DeviceId=’C:'”|

Format-Table SystemName, @{Name=”Free”;Expression={[math]::round($($_.FreeSpace/1GB), 2)}},
@{Name=”Total Size”;Expression={[math]::round($($_.Size/1GB), 2)}} –auto
The list of Servers is stored under C:\temp\Servers.txt.
The output will give the Computername, Total Disk Space and Free Disk Space.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: