Here at the university we use Perfmon alerts to alert us when Windows server hard disks are dangerously close to filling up. Sometimes, it’s nice get an idea of what the hard disks are at, looking to see if any disks are getting close to running out of space without getting an alarm in the middle of the night.
This script queries Active Directory for a list of computers. By default, it checks the Computers container and the Domain Controllers OU, but feel free to change it to fit your needs. It then creates an array of structs, sorts those structs by free megabytes, runs the PrintContents method of the struct, dumps the info into a TSV file, and emails it off. Enjoy!
| Attachment | Size |
|---|---|
| diskStats.txt | 20.39 KB |
