Exchange Dashboard Organization – “Email Report” PowerShell Script

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.

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

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

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.


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 browsing



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 -MailTo -MailServer

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

How to schedule it?

If you want this script to be run as a schedule task, check my post here showing step by step walk through.


Here some recommendations:

– to learn more about how to schedule the script using task manager, check this post.

– 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.

– If you want to use the SendEmail feature and your SMTP server requires authentication, then locate line 2110:

 $smtp = new-object Net.Mail.SmtpClient($smtphost)

and add the following lines below it:

$user = “contoso\username”
$passw = “mypassword”
$smtp.Credentials = New-Object System.Net.NetworkCredential($user,$passw);
$smtp.EnableSsl = $false

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

69 comments on “Exchange Dashboard Organization – “Email Report” PowerShell Script

  1. Pingback: My Exchange Environment Dashboard v 2.0 to be published in a week (30 April 2014) !! | Ammar Hasayen - Blog

  2. Pingback: New Exchange Organization Report (version 2) is coming soon | Ammar Hasayen - Blog

  3. Pingback: The most amazing “Exchange 2010 Dashboard Report” Script Monitor | Ammar Hasayen - Blog

  4. Dear Ammar,
    First of all thanks a lot for the “Fantastic” script, it works like a charm and really helps a lot providing additional details.
    Also thanks a lot for providing me with the opportunity to test your script with my environment and provide feedback, I was able to learn quite a lot from you, appreciate it a lot.

  5. I have been using the old version to monitor my organization email system, and I have to say that this version is more stable, faster and the addition of log files is welcomed.
    I am also so glad that this version finally supports all Exchange versions as we are transitioning to Exchange 2013 now.
    Charts are appearing more clean and expanding as described in the read me document.
    Well Done.

  6. I just downloaded the script and tried it in big email deployment.It finished very fast without any errors and i am so glad to have the charts.
    Well done Ammar !

  7. Gr8 script indeed. Liked the DB Activation Layout table as it helped me a lot plan a head new database addition. Charts are amazing too. Keep it up.

  8. Excellent Script! Very powerful and useful.
    The report generated has become a vital tool when having discussions with management regarding the changes in our Exchange Environment.
    Thank you Ammar!

  9. Awesome script Ammar, one change I have made that I’d like to suggest is a modification to line 6109, mine now reads:
    Generated $((Get-Date).ToString()) from $ENV:ComputerName
    This simply reminds me which server the script is running on. Very helpful when you have a lot of reports coming in.

    • Nice trick..I usually use dedicated server for running my for my Exchange architecture posts to get my idea! Thanks for your kind feedback.. I hope you liked it!

  10. Hey Ammar,
    Again nice job on the script!
    We have a very large environment…the changes to the charts are a lot better that in the previous versions. But is there anyway we can break them into multiple charts … say per DAG? We have over 200+ databases split between several DAGs globally. All mushed together in one chart ……well I’m sure you get the idea. Its minor but just a thought.
    Next…the drive size thresholds! I would love to have that back! Again we are a very large environment and looking through all those databases, having the thresholds, help make the ones stand out that need to be. I currently went back to v1.2 just for this option. Is there some easy way to add this back?
    Thanks again!

    • Let me give u the threshold one first. .hopefully in a week or two I can give a beta to try.. thanks for your feedback.
      Regarding charts, its hard becsuse attaching multiple files to the smtp object will become complex and may crash depending on the number of DAGs…but will look at it…

  11. hi there

    Great Script……im getting the HTML Report and teh DAG report but how do i get the Charts?? is there a command i need to run?

    many thanks

      • I have the same issue with Exchange 2010.
        I have 6 Log disks being mounted onto a disk H as H:\LOG1, H:\LOG2, etc.

        The script will report the free space on the disk H:\ instead of the mounted volume. This also happens with the original script.

      • I fixed the issue with the mounted log points by changing line 3436 into

        if ($($Database.LogFolderPath.PathName +”\”) -eq $($Disk.Name))

        Cheers 🙂

      • I do not know how this solved it…
        The original script line is
        if ($Database.LogFolderPath.PathName -like “$($Disk.Name)*”)

        Now the $Database.LogFolderPath.PathName usually will be something like (D:\DB016\LOG) , while ($ will be something like (D:\DB016\), so i guess the original script line shall do the trick.

      • That would work if the $Database.LogFolderPath.Pathname has a longer name than $Disk.Name – the original script assumes that the log folder is a folder within the disk, which is best practice.

        In my case the log location is a folder within the disk, but it in itself is a mountpoint (a disk) as well. The disks were mounted into folders which are immediately used for logging (why would I make a mount with another folder in it ?)

        “H:\LOG3″ is like “H:\*”, so it matches on the H:\ disk which is only 1GB and contains the mounts. This is caused by the star, and the order in which the disks array is filled.

        with my change
        “H:\LOG3″ + “\” != “H:\”
        “H:\LOG3\” + “\” == “H:\LOG3\” so it matches only and exactly on the “H:\LOG3\” disk

        (edit: sorry, my first reply got under the wrong thread so I replied again)

      • I have confirmed mounting points are reporting wrong disk space. I have sent you a copy of a fix on your email. Please tell me if it works so i can publish the modification.

        Instead of your suggested modification, i have sorted the disks so that mounted points get evaluated first. This is a cleaner way to deal with the problem i guess.

      • The version you sent me did not fix the issue I experienced.

        I’ll keep to my fix in my personal copy as this works for my situation (and any other situation as far as I can see). Doing a test on a path where you use a -like is simply too error-prone.

      • I knw the reason but fixing this will require rebuilding the whole structure of the containers that moves between hash tables. Will try to do a re structure for the script this summer.

      • Yes version is somehting that need to be maintained in the script code each time a new update is published. I may do a full update on the script this summer to add some features about hybrid deployments

  12. i appear to have issues scheduling this as a task? It runs but it doesnt seem to complete, yet if i run it without a schedule it seems fines? Im using SYSTEM as the account ot run it as when set as a task

    • That would work if the $Database.LogFolderPath.Pathname has a longer name than $Disk.Name – the original script assumes that the log folder is a folder within the disk, which is best practice.

      In my case the log location is a folder within the disk, but it in itself is a mountpoint (a disk) as well. The disks were mounted into folders which are immediately used for logging (why would I make a mount with another folder in it ?)

      “H:\LOG3” is like “H:\*”, so it matches on the H:\ disk which is only 1GB and contains the mounts. This is caused by the star, and the order in which the disks array is filled.

      with my change
      “H:\LOG3” + “\” != “H:\”
      “H:\LOG3\” + “\” == “H:\LOG3\” so it matches only and exactly on the “H:\LOG3\” disk

    • Also is it possible to have these all gathered in an HTML dashboard on the email ?
      I am trying to use the send email feature now – but it didnt work. Running it again, currently.

  13. Thank you for the great work!
    Only one question for me, as I have all scheduled job run on a particular server which is not an Exchange servers. If running only on Exchange server is about “The script logic cannot determine if PS version is E2013 or E2010”, can we specific it in the script so I can run the script on non-Exchange server?

    • Hi there and thanks for your feedback. This is a very critical point indeed. Let me explain first why this is a requirement to run the script on exchange server. Since the script will query and support all exchange versions, it is a fact that commands are different when the powershell host is exchange 2010 or 2013 or 2007.
      So the script need to identify the powershell host encironment carefully and accordingly choose the right commands to query your exchange environment.
      Saying that, the script is configured to exit and report that it cannot determine the powershell version if running from non exchange server.
      What I blogged about is to have your script server configured as standalone mailbox server with no databases mounted on it.this way you can use your script server to run all exchange scripts and also instead of connecting to live exchange server to do the query, you will be using your script server to do the actual processing.

  14. Thank you for this useful script!

    Even so on Ex2013 I can’t see Ex2013 under Total Servers (the Count is right) and also the script can’t read the Exchange Version and the OS Service Pack. An Edge 2010 Server is listed with the right values. Any tips?

  15. Thanks for this script, great job. Just wondering if it’s possible to add more information to the report around the users, such as which users have forwarding / redirect rules enabled on their mailboxes?

  16. Jazaka ALLAH khayran, great job, I had a similar script developed by steve goodman, and I thing this one has much more information, so thank you again

  17. Pingback: Exchange Server 2013: 사용자별 사서함 크기(Quota) 조사 | 아크몬드넷

  18. Hi Ammar

    This is excellent work. Your script is very helpful. Thank you so much!
    We run it on a scheduled basis.
    There are only two points which I would like to ask, which would make life more easy while comparing the reports:
    – Under Site: APPS-SITE where the CU version of all servers is listed. I do like to have the server names sorted (A – Z).
    – In the main section where all DB’s and their properties are listed. I do like to have the DB’s sorted by name (A – Z).

    Would this be possible?

  19. any plans to update this so it detects Exchange 2010 sp3 RU10?
    I`m not sure but I wouldn’t be surprised if it detect the latest Exchange 2013 RU version eithers.

    Steve Goodman`s doesn’t either 🙂

  20. any plans of upgrading this so that it detects the latest exchange ru`s?
    doesn’t detect exchange 2010 sp3 ru10, wouldn’t be surprised if didn’t detect 2013 ru latest version either.
    steve`s hasn’t been updated yet either 🙂

  21. Pingback: Exchange 2013:사용자별 사서함 크기(Quota) 조사 | Office365 Blog

  22. Excellent script, I love the way it runs so smooth, is there a way to get all the information on the same page instead of attachment files ?

  23. The script fails on get-mailboxdatabase -status

    – Exchange Servers detected : 10
    2.2 Get-MailboxDatabase -Status Info (with filter if any)
    You must provide a value for this property.
    + CategoryInfo : NotSpecified: (0:Int32) [Get-MailboxDatabase], DataValidationException
    + FullyQualifiedErrorId : 16B82D46,Microsoft.Exchange.Management.SystemConfigurationTasks.GetMailboxDatabase

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s