Exchange Database Health Get-DBCopyHealth

This post is updated to include information about the new version of the script (Version 3) published in April 2015 and includes a filter option to filter by DAG.

Hi everyone,

I got couple of requests to enhance and add new features on my script that reports if any Exchange DB is dismounted or placed on not optimal server according to the activation preference. See my previous post

Script Features

This script will collect all your Exchange databases and will report two things:

  • If any database is mounted > Email notification will be sent
  • If any database got switched over to another server > Email notification will be sent to report that the DB is not mounted on the server with activation preference =1 (not the optimal location)

The idea behind the script is to schedule it to run every hour or so, and you will get email notification only if something bad happens.

I explained more in a previous post more about this script and functionalists, but now i have created a new version (Version 2 ) with new features:

  1. Exchange 2013 support
  2. Reporting the current mounting server location in addition to where the DB should be mounted
  3. Switch Option to disable checking for mounting status if needed
  4. Verbose logging
  5. Performance enhancement
  6. Option to run the script without Email notification option
  7. Now you can filter databases with the InputDAG option, so you can provide a list of DAG names.


Run the script from PowerSehll without SMTP email notification
.\Get-DBCopyHealth.ps1 -HTMLReport myfile.html

Run the script from PowerShell and filter for databases on DAG1 and DAG2
.\Get-DBCopyHealth.ps1 -HTMLReport myfile.html -InputDAGs DAG1,DAG2

Run the script from PowerShell with verbose logging and without SMTP email notification
.\Get-DBCopyHealth.ps1 -HTMLReport myfile.html -verbose

Run the script from PowerSehll without SMTP email notification. We do not want to check mounting status, only optimal DB placement
.\Get-DBCopyHealth.ps1 -HTMLReport myfile.html -DontCheckMountStatus

Run the script with Email report option
.\Get-DBCopyHealth.ps1 -HTMLReport myfile.html -SendMail $true -MailFrom -MailServer -MailTo




Download Version 3 here

Click here to get the Get-DBCopyHealth version 3:  Get-DBCopyHealth


3 comments on “Exchange Database Health Get-DBCopyHealth

  1. Nice work but a question and an issue….Why does it has to be run on the Exchange Server. Cant I run it where the mgmt tools are installed

    • It is because we need to determine the command to use to pull database information.. so if the exchange server is 2010 then we will add a switch to get pre 2010 daatabases and so on and so forth.

  2. Thanks… Can we make a change where it can be run from a Non Exchange Server where mgmt tools are installed… thanks again

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