Most Amazing Exchange Email Report

Get-CorpEmailReport.ps1 V2.4.8  is an Email Organization Report and a great tool for IT Professionals who are working with Microsoft Exchange systems.

This report will get organization wide information about your Email infrastructure, from Exchange servers O.S info, service health, up time details, beside Exchange and database highly aggregated information.

Not only will you get a nice Dashboard describing your Exchange, you will get aggregated information about how much resources your email infrastructure is consuming in terms of server count, mailboxes and total storage.

Aggregated Data

The script will also present a nicely formatted tables with aggregated information like the mailboxes per type, Exchange servers per role and version, and also mailbox and archives count, sizes and average size.

HTML Table

Script Charts

What makes this script unique and outstanding, is the chart module. Nothing more exciting than parsing the output data in sorted nice looking charts.

Four charts will be generated after running the script. Each chart is designed carefully to get the information that matters most to IT Professional.

Chart Module uses a smart algorithm that will get information from your Exchange organization, digest it, and then decide what is the best way to output the chart depending on the number of data items. In this way, you will not get small crowded charts with hard to read data, instead, the graph dimensions will be scaled dynamically according to the number of items to draw.DB vs Backup Since

DB vs Size

MBX vs DBs Mounted

MBX vs Mailboxes

DB Activation Preference Table [New]

Have you used the product team Exchange calculator where you input your data and a nice formatted table get generated for all your databases, and their copy distribution along with the activation preference?

The script is intelligent enough to collect your DAG information, database copy locations, their activation preference, and then generate a similar live dashboard with a colored cell indicating a red alarm if a database is mounted on a non-preferred mailbox server.

DB Activation

Scope your script with three Filters [New]

The script ships with a new module to handle filtering and scoping your script. Sometimes, you want to get a report for certain DAGs only, so you can use the DAG filter.

Maybe you want to just get information from certain Exchange servers, so you can use the Server List filter and just write a comma separated list of servers.

Finally, you can use the Expression filter, where you can use the wildcard character (*) to write something like “NL*” to get information from server names started with NL.Filter

Detailed information for Servers and Databases

 Of course the script will not be perfect if a detailed information is not presented. The script will start creating HTML tables for all your Exchange servers with all detailed information, including version, OS Info, Roll Up Updates version, Service health, Up Time information and more.

Also, for each database, you will get a detailed information about the database and all its properties with smart thresholds that you can customize.


Easy Script Code Browsing

The script code is divided to 7 modules to make it easy for you to dig deeply into the script code and reach the functionality you are looking for. The script also uses (Regions), so if you are using new PowerShell script editor, you will be able to expand each script region separately for better script browsingCorpEmailReportSnapshot2

Download the Full Documentation

Download the script Documentation here:

Email Organization Report v2.4.8 Description

Download the Script here

Download the script from here : Get-CorpEmailReport_V2.4.8

Examples to run the script

Generate the HTML report and supplying the current directry as a script path to create output files
.\Get-CorpEmailReport.ps1 -ScriptFilesPath .\

Generate the HTML report and supplying the custom directory as a script path to create output files
.\Get-CorpEmailReport.ps1 -ScriptFilesPath C:\MyFiles

Generate the HTML report and Filter by servers that start with “NL”
.\Get-CorpEmailReport.ps1 -ScriptFilesPath .\   -ServerFilter “NL*”

Generate the HTML report and Filter by including only Ex1 and Ex2 servers
.\Get-CorpEmailReport.ps1 -ScriptFilesPath  .\  -OnlyIncludedServers  Ex1,Ex2

Generate the HTML report and Filter by including only Servers that are member of a DAG called “DAG1″
.\Get-CorpEmailReport.ps1 -ScriptFilesPath .\  -InputDAGs  DAG1

Generate the HTML report and use PowerShell Remoting for WMI data collection
\Get-CorpEmailReport.ps1 -ScriptFilesPath .\  -WMIRemoting

Generate the HTML report with SMTP Email option
\Get-CorpEmailReport.ps1 -ScriptFilesPath .\  -SendMail:$true -MailFrom -MailServer

Generate the HTML report with disabling ViewEntireForest option
\Get-CorpEmailReport.ps1 -ScriptFilesPath .\  -ViewEntireForest:$false

How to schedule it?

If you want to run this script as a Scheduled task, check my post here.


Here some recommendations:

– Start running the script with -OnlyIncludedServers switch at first, so you can scope the script to one Exchange Server at first (.\Get-CorpEmailReport.ps1 -ScriptFilesPath  .\  -OnlyIncludedServers  Ex1 )

– Run the script from Exchange Management Console and from an Exchange Server.

– Best condition to run the script is from PowerShell 3.0 and above. Click here for a nice blog post about this.

– If you have an Exchange Edge Servers and want to the script to access it, see this link.

Copy Rights

The script is based on Steve Goodman, a Microsoft MVP at the time of writing this document. Steve Script: “Generate Exchange Environment Reports using PowerShell” Version 1.5.8, 2nd Feb 2014, is used heavily as a foundation to build this script.

Steve worked hardly in writing an outstanding script to collect information from all versions of Exchange servers, and get a nicely formatted output. This script extends Steve’s script functionality by adding a lot of functionalities like: new on screen progress, charts, HTML DB Activation output, PowerShell Remoting module, Log files tracking, more aggregated data, new table for Mailbox type, new table for Recovery Databases, threshold options, two new Filter functionality (by DAG names, and by Server names), new module for error handling and logging, more data collected for Exchange and Databases.

A separate communication with Steve has been done to ensure copy rights before releasing this extended script. I encourage you to visit his blog and browse his script: 

Similar Scripts

35 comments on “Most Amazing Exchange Email Report

  1. Hi,

    Nice script, many thanks ! A small mistake line 6183 and 6190. Values are in MB, not GB

    in ExReportDetailed.log, you see 2890 MB:
    2015-03-31 08:26:17: Section : Getting Total Aggregates
    2015-03-31 08:26:17: – Total Archives Count: 9
    2015-03-31 08:26:17: – Total Archives Size: 25,41 GB
    2015-03-31 08:26:17: – Average Archive size: 2 890,91 MB
    2015-03-31 08:26:17: – Total DB Sizes: 546,75 GB

    and title of table is GB 😉

    Modified line:

    $Output+=”Average Archive Size (MB)”

    $Output+=”$($ExchangeEnvironment.Average_Archive_size) MB”

    Best regards.

  2. Greetings, i wanted to use your Get-CorpEmailReport script but i am getting bellow Error

    Cannot process argument transformation on parameter ‘SendMail’. Cannot convert value “” to type “System.Boolean”, parameters of this type only accept booleans or numbers, use $true, $false, 1 or 0 instead.
    + CategoryInfo : InvalidData: (:) [Get-CorpEmailReport_v2.4.8.ps1], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-CorpEmailReport_v2.4.8.ps1

    I am new at powershell and i really need to use this script to get exchange report.

  3. Pingback: Exchange Dashboard Email Report – New version available v2.4.9 | Ammar Hasayen - Blog

  4. Pingback: How to run PowerShell Scripts efficiently from Task Scheduler? | Ammar Hasayen - Blog

  5. Hi Ammar, I like your script very much, is there a way to stop the script from erasing the folder where the reports are created and then recreate the folder back?

  6. HI Ammar, i want to add the incremenatal backup details and Services health in this report. is it possible?? please let me know..

  7. Hi, great script. Im trying to send to more than one recipient using the mailto command. How can I do this without creating a dist. group?


  8. very great script, thank for it, but no mail are send mit error 5.7.1 user must authenticated. should i create a receive connector for anonymous?

  9. Hello, I am wondering if database size and disk space thresholds are able to be changed as they were in the older versions of your script?

  10. Hi,
    great work as usual but there is something wrong in Update Rollup function for Exchange 2010 ’cause Update Rollup 10 or 11 are never detected.

    • The problem is related to line 2990 where you compare integer with string using -ge
      if ($tRU -ge $RollupLevel) { $RollupLevel=$tRU; $RollupVersion=$tRUV }
      parsing all Update Rollup you find
      4 -ge 0 –> True
      5 -ge 4 –> True

      10 -ge 9 –> FALSE ’cause of powershell way of compare
      I solved it modifyng line 2987 fom
      $tRU = $_.Split(” “)[2]
      $tRU = $_.Split(” “)[2] as [int]
      That is not the best way but I’m not a programmer.


      P.S. This way I have
      2015-10-05 14:38:51: – RollupLevel : 10

      • I have changed the line to [int]$tRU = $_.Split(” “)[2] and now the latest rollup pack is showing.

  11. This script is absolutely amazing and a must have for any Exchange admin’s tool kit. I accidentally came across it via a Google search for something else, but I struck Script gold and so glad I did !! I will be telling every mail admin I know about it from now on.

  12. Thanks so much for your effort
    I just want to ask some questions:
    1- Is this script valid for Exchange 2007?
    2- if it’s not is there any trusted script you make or you know giving the same information as your script do?
    3- if it’s valid with Exch 2007 what about the environment that is running 2 MB and 1 CAS and Hub server? how and which server i have to run this script?

    Thanks once again and hope for you more success.

  13. Pingback: How to Create a PowerShell Script as Scheduled Task | Aslam's Blog

  14. Hi this is a great report and I run it with a script and scheduler every day on my exchange and i can send the mail fine to my email address, but when i change the script to send the email to my it group distribution list or any other email address inside my orginazation, the mails does not come through for some reason, and i cannot figure out why… This is my script

    Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
    C:\Scripts\HealthReport\Get-CorpEmailReport_v2.4.9.ps1 -ScriptFilesPath c:\scripts\healthreport\new -SendMail:$true -MailFrom -Mailto -MailServer

    It comes through fine but when i change the email address to send to to my distribution group the mail does not get delivered to the distribution group, any other emails is going to the distribution group fine

    Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
    C:\Scripts\HealthReport\Get-CorpEmailReport_v2.4.9.ps1 -ScriptFilesPath c:\scripts\healthreport\new -SendMail:$true -MailFrom -Mailto -MailServer

    Anybody have any ideas???


    • Message tracking would tell you where the issue lies, however I would have a guess and say that the distribution group you are sending to will only accept emails from senders that are authenticated, you might need to change the settings on the distribution group “only accept mail from authenticated users”

  15. Hi, your script is very good. I do however has an issue where I add it in the scheduled task and will run everyday at 8am.

    I followed your post on how to schedule it. My problem right now is that it runs the first instance and was able to send email to me. When I try to run the same tasks, it throws the following error:

    WARNING: 2017-08-23 15:45:12
    2017-08-23 15:45:12: ————————————————————
    2017-08-23 15:45:12: Error Report
    2017-08-23 15:45:12: —————————————-
    2017-08-23 15:45:12:
    2017-08-23 15:45:12: Error in D:\support\scripts\Get-CorpEmailReport.ps1.
    2017-08-23 15:45:12:
    2017-08-23 15:45:12: —————————————-
    2017-08-23 15:45:12:
    2017-08-23 15:45:12: Line Number: 4993
    2017-08-23 15:45:12: Offset :
    2017-08-23 15:45:12: Command: Remove-Item
    2017-08-23 15:45:12: Line: Remove-Item $ScriptFilesPath -Force -Recurse -ErrorAction Stop
    2017-08-23 15:45:12: Error Details: Cannot remove item D:\support\scripts\EmailReportFiles\DB
    DAG Layout.Html: The process cannot access the file ‘DB DAG Layout.Html’ because it is being used by another process.
    2017-08-23 15:45:12: Error Details: System.Management.Automation.InvocationInfo
    WARNING: More Custom Info: [Module Factory – Deleting old working directory] Could not delete directory

    It seems that the file “DB DAG Layout.Html” is left open and the script tries to delete it . Kindly update, thanks.

    • Hi delete the files your self, make sure the account running the schedule task has access to the file location and then run the task again. Do it run the script manually as this will create the files on ur user context which makes it hard for the schedule task to delete

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s