Generate Exchange Environment Reports using Powershell


Update 2nd February – V1.5.8 – Exchange 2013 CU and SP support, HTTPS and CAS array names shown, initial Office 365 Hybrid support (see here for more information)

Update 19th January – V1.5.6 – Exchange 2013 support and bug fixes (see here for more information)

Update 17th August – V1.5.4 – New features and bug fixes (see here for more information)

Update 24th July – V1.5.3 – Bug fixes (see here for more information)

Update 21th July – V1.5 – Re-write with new features including Exchange 2003 support for mixed environments and more detailed information (see here for more information)

Update 21th June – V1.1 – Bug fixes, Exchange 2007-only support in addition to 2010/2010+2007, and new features.

As an Exchange administrator, there’s times when it’s useful to have a visual, straightforward and concise document that gives you a good overview of your environment. Although with tools like Visio and Word you can make such a document, it’s hard to keep these documents up to date or use previous versions to track and check changes.

This script, inspired by the output of an Exchange TAP tool, aims to automatically generate a report that gives you an overview of your environment, Exchange 2003, 2007, 2010 and 2013 servers and database availability groups – in particular:

  • Total Servers per Exchange version & service pack
  • Total Mailboxes per Exchange version & service pack, plus Office 365 remote mailboxes
  • Totals for Exchange roles across the environment
  • A site-by-site breakdown for the following:
    • Mailboxes per site
    • HTTPS FQDNs used for Internal, External and SCP URLs
    • CAS array names
    • Exchange servers, version, update rollup and version, service level, highlighted installed roles, OS version and service pack


  • A breakdown of each Database Availability Group including:
    • DAG name, member count and member list
    • Database information such as
      • Name
      • Mailboxes per database and Average Size
      • Archive mailboxes per database and Average Size only shown if a DB includes Archive mailboxes
      • Database and whitespace size
      • Database and log disk free space percentage
      • Last full backup date/time (new) – only shown if at least one DAG DB has had a full backup
      • Circular Logging state (new) only shown if at least one DAG DB has circular logging enabled
      • Server hosting the active copy
      • List of servers hosting copies and copy count


  • A breakdown of Non-DAG databases including Exchange 2007 and 2003 DBs, including the database information above, along with Storage Group name (where applicable).

The script doesn’t support detailed information about Exchange 2007/2003 CCR/SCC clusters, but these are shown as ClusMBX in the output. At the moment, the script doesn’t show Public Folder information but if there is interest I can add extra features; and of course the source is provided should you wish to alter it to your own needs.

To be able to execute the script, you need to use the Exchange Management Shell (the latest version for your environment, with Powershell 2.0) and be able to get information about AD Sites, Exchange Servers, Mailboxes, Database Availability Groups and Databases. It uses WMI to retrieve OS information and detect Exchange 2007 clusters and calculate Exchange 2007 database size and Remote Registy calls to get Update Rollup information. A normal Exchange administrator should be able to perform these tasks.

Executing the script is straightforward – the only setting you need is to specify where to write the HTML file:

.\Get-ExchangeEnvironmentReport -HTMLReport c:\report.html

If you want it to email the results, the follow parameters are available to allow the report to be sent directly from the script:

.\Get-ExchangeEnvironmentReport -HTMLReport c:\report.html -SendMail:$true

Finally, to schedule the report to be generated nightly, execute with your preferred options and add the -ScheduleAs parameter, for example:

.\Get-ExchangeEnvironmentReport -HTMLReport c:\report.html -SendMail:$true -ScheduleAs:DOMAIN\user

After generating the report, it will attempt to schedule the task and prompt (via schtasks.exe) for the password of the user you have chosen to schedule the report as.

As usual, the script is provided to download as-is without any warranties, at the bottom of this post. Comments and suggestions are always welcome.

Download Get-ExchangeEnvironmentReport.ps1

Looking for the previous version, 1.5.4? Download it here


560 thoughts on “Generate Exchange Environment Reports using Powershell

  1. Pingback: Top 5 Tips for Migrating to Office 365 - Essential Computing

  2. I’m running this script from a workstation with Exchange 2013 tools installed. I get errors, and while the HTML report is generated and the DAG information is displayed, there are no databases listed and no details about the databases

    • Hiya, it should work fine with Remote PowerShell (that’s what I assume when you say 2013 tools on a workstation) but it is designed to run on-server. What errors do you get? Do you have connectivity to all servers?

  3. Steve, Great Utility! Definitely useful for sizing when looking to upgrade, as well as current state snapshot.

    Any thoughts to adding a more detailed outputs. For instance giving advanced options to gather URI configurations, certificate, send/receive connector settings, etc?

    I might give it a go and add these things in as well either through separate powershell scripts or expand on this one.


    • Hi Ken, I’ve thought about it – I wonder if a more detailed PDF report would be more appropriate if that were the case as it would be hard to show the info concisely

  4. Great script/information…if I just wanted Database Availability Group Members and not the other parts how would i do that?

    • Hi David, it is spit into commented sections at the end that generate HTML in functions (IE a named command that makes each table of data), so you should be able to delete the bits you want easily.

  5. I ran this manually and get the HTML file in the specified folder, but the email fails with this PS error message:

    Send-MailMessage : Service not available, closing transmission channel. The server response was: 4.3.2 Service not

  6. Same here, Exchange 2013 CU and Exchange 2010 SP3, doesnt display the 2013 info, gives databases and everything else but not the version of exchange 2013.

    • just search and add whats missing i the script.
      $ExSPLevelStrings = @{“0″ = “RTM”
      “1” = “SP1″
      “2” = “SP2″
      “3” = “SP3″
      “4” = “SP4″
      “CU1″ = “CU1″
      “CU2″ = “CU2″
      “CU3″ = “CU3″
      “CU4″ = “CU4″
      “CU5″ = “CU5″
      “CU6″ = “CU6″
      “CU7″ = “CU7″
      “CU8″ = “CU8″
      “CU9″ = “CU9″
      “SP1″ = “SP1″
      “SP2″ = “SP2″}

  7. exchange 2010 SP3 RU4

    runs fine from powershell but when i manually run it from Task scheduler nothing happens. no errors from task

Leave a Reply