PowerShell Script to find out C:\ Drive Space of the System

Posted on: April 12, 2013

We are often Worried about , how much C:\ Drive Space is left on our Server or Client systems . Below script will help us to find out the C:\Drive space on Multiple servers and output will be save in CSV File with server name and its C:\Drive FreeSpace in GB

Get-WMIObject Win32_LogicalDisk -filter “DeviceId=’c:'” -computer (Get-Content c:\Computers.txt) | Select SystemName,@{Name=”freespace(GB)”;Expression={“{0:N1}” -f($_.freespace/1gb)}} | out-file C:\FreeSpace.csv –force

C:\Computers.txt contains list of servers/client systems on which you want to perform the Query

C:\FreeSpace.csv is output file where query result will be stored.

Hope this helps.


-Prashant Girenanvar.

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: