Create Monitoring drive storage

Here is one of my first completed working PowerShell scripts.

This code is pretty simple. All we are doing is looking at a set of hosts (must be windows based) and using WMI objects to gather information about the local disks attached to the host. We then condition that information to a readable format and display total disk size and the free space available on each drive. This is then saved to a log file and emailed out using .NET framework. After the file is emailed it is date stamped and archived.

This is a handy script for environments that have a large amount of disks constantly being written too. One example of using this script is to monitor the free space on our backup server drives. Our backups are stored on hard drives until they are scheduled to duplicate to tape so it is essential to have a close eye on hard drive capacity.

Feel free to use the script as you please but I do ask you keep my header included.

Pro tip: You can use “Windows Scheduler” to automatically run the script at desired intervals.