Windows PowerShell is Microsofts solution for automate administative tasks on local or remote Windows systems. The task are written in PowerShell scripts and executed on the command line.
The solution of the problem is to write a script, that remote connects to each target server and read out the disk size and free space of each disk. The script sends the result to an email adress.
The monitored servers are saved in an txt file. The script is sceduled by the windows task scheduler once a day.
The interesting part of the script
foreach($server in $servers)
{
$disks = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk;
foreach($disk in $disks)
{
$size = $disk.Size;
$freespace = $disk.FreeSpace;
}
}
This information can be outputed directly or further processed by the script
This information can be outputed or