Reporting on disk usage

Keeping an eye on hard disk utilization is a key component in any monitoring solution. Depending on the environment, Exchange databases can grow quickly, and several gigabytes of log files can be generated in a short period of time. Obviously, you need to know if you are getting low on free disk space. In addition, you may want to track your disk utilization over time to plan upgrades and changes to your systems. This recipe will show you how you can quickly report on the disk usage on each of your servers.

How to do it...

  1. One of the quickest ways to determine disk usage is using WMI. Use the following code to display the capacity and free space of each local fixed disk:
    Get-WmiObject Win32_LogicalDisk -Filter "DriveType='3'" ...

Get Microsoft Exchange 2010 PowerShell Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.