Link to home
Start Free TrialLog in
Avatar of SAM2009
SAM2009Flag for Canada

asked on

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
Avatar of oBdA
oBdA

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

Avatar of SAM2009

ASKER

Thanks but how can I get just C: drive?
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SAM2009

ASKER

Thanks a lot!