MVP - Most Valuable Professional

Just can't get enough of IT

This blog is about mostly anything in IT. But the primary focuses are Microsoft technologies like Exchange Server, Microsoft 365, Microsoft Teams, and Cloud Security.


This script fetches the disk volume (Win32_Volume) information via WMI and shows the results in the PowerShell command line window. Optionally, you can have the report sent as an Html email to a recipient of your choice.

The switch -AllExchangeServer simplifies gathering the disk volume information across all Exchange servers in your environment.

The following screenshot shows the command line output when using

.\Get-Diskpace.ps1 -ComputerName MYSERVER

Get-Diskspace command line output

The following screenshot shows an example of the html email output when using

.\Get-Diskpace.ps1 -ComputerName MYSERVER -SendMail -MailFrom -MailTo -MailServer

Get-Diskspace email example


# Get disk information from computer MYSERVER in MB

Get-Diskpace.ps1 -ComputerName MYSERVER -Unit MB

# Get disk information from all Exchange servers and send html email

Get-Diskpace.ps1 -AllExchangeServer -SendMail -MailFrom -MailTo -MailServer

Version History

  • 1.0, Initial community release
  • 1.1,  Email reports added
  • 1.11, Send email issue fixed
  • 1.12, PowerShell hygiene applied



Additional Note

This Powershell script has been optimized using the ISESteroids™ add-on. Learn more about ISESteroids™ here.

Read More »