How to check free space on few Windows servers?

Hi,

Is there a way by Powershell or any tool (light one) to run a report which can give me the space used and free space  for X numbers of servers? This is just for few servers and I check it from by workstation.

Like I need used and free space on C: drive for 5 Windows 2008 servers:

Server01  SpaceUsed: 50GB  FreeSpace: 3 GB
Server02  SpaceUsed: 50GB  FreeSpace: 3 GB

Thanks
LVL 1
SAM2009Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oBdACommented:
Like that, for example:
$computers | ForEach-Object {
	Get-WmiObject -Query 'Select * From Win32_LogicalDisk Where DriveType=3' -ComputerName $_ |
		Sort-Object -Property Name |
		Select-Object -Property `
			PSComputerName,
			Name,
			@{n='Size (GB)'; e={[math]::Round($_.Size / 1GB, 2)}},
			@{n='Free Space (GB)'; e={[math]::Round($_.FreeSpace / 1GB, 2)}},
			@{n='Used Space (GB)'; e={[math]::Round(($_.Size - $_.FreeSpace) / 1GB, 2)}}
}

Open in new window

SAM2009Author Commented:
Thanks but how can I get just C: drive?
oBdACommented:
Just filter for the name (and you can drop the sort now, obviously):
$computers = 'Server1', 'Server2'
$computers | ForEach-Object {
	Get-WmiObject -Query "Select __Server, Name, FreeSpace, Size From Win32_LogicalDisk Where (DriveType=3) And (Name='C:')" -ComputerName $_ |
		Select-Object -Property `
			PSComputerName,
			Name,
			@{n='Size (GB)'; e={[math]::Round($_.Size / 1GB, 2)}},
			@{n='Free Space (GB)'; e={[math]::Round($_.FreeSpace / 1GB, 2)}},
			@{n='Used Space (GB)'; e={[math]::Round(($_.Size - $_.FreeSpace) / 1GB, 2)}}
}

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SAM2009Author Commented:
Thanks a lot!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.