10/09/2013: Today's post will outline a remote drivespace reporting script that I routinely use to monitor and report on the available Transaction Log space on my Exchange servers. The script leverages WMI to remotely query for the current freespace & volume size metrics (
on either specified drive letters, or all Volume Mount Points on the target system), calculates the space in terms of
gigabytes and
percentage-free, outputs a report file, and emails the results to an admin mailbox.
I'd generally design this type of script to leverage
Exchange Management Shell and dynamically query all servers in the appropriate site in the mailbox role (
to automatically accommodate server adds and removals over time). But in this case I wanted this script to be 'blind' to Exchange version differences and also avoid a dependency on
Exchange Management Shell. A specific goal in this case was to provide a tool to enable junior admins to evaluate the drive status after backup failure alerts,
without the need to run the queries from a machine with a specific version of the Exchange Management Tools installed. So I instead use semicolon-delmited string variables to statically store arrays of server names for processing within the script itself.