Using Test-ReplicationHealth to Troubleshoot Database Availability Groups

Using Test-ReplicationHealth to Troubleshoot Database Availability Groups

Database availability groups are reasonably smart and robust systems, but they do need monitoring, or else you might find one day they are not providing the HA that you need them to. One of the useful PowerShell cmdlets for keeping an eye on things is Test-ReplicationHealth. It can be used to help troubleshoot database availability groups by running it locally or against a remote server.

To test a remote server, use the -Identity parameter.

The cmdlet also accepts pipeline input, however if you were to simply pipe Get-MailboxServer into it and you have Mailbox servers in the organization that are not DAG members then you risk seeing errors in your results that just get in the way. Instead you can pipe only the members of a database availability group into Test-ReplicationHealth using the following method:


The number of tests shown in the output of Test-ReplicationHealth will vary depending on which version of Exchange you’re running, and whether the DAG member has only active or passive databases on it at the time. Not all tests are relevant if the server has only active, or only passive databases on it.

There’s a lot of output to look at, so it’s often easier to filter the results to only those that have not passed.

The error details are usually truncated, so outputting the results as a list will let you see more information.

By the way, if you’re curious about what each of the tests do, there’s a “CheckDescription” provided for each of the checks that Test-ReplicationHealth performs. Some of them are still a bit vague, but there’s some useful info there that can help point you in the right direction to investigate further.



Use Mailscape today to unlock complete Exchange visibility within an hour.

  • Immediately isolate problems with an at-a-glance heatmap
  • Out-of-the-box synthetic transactions that test core Exchange functionality
  • End-user experience probes that monitor Exchange performance in remote offices

Try Mailscape for free with a 14-day trial.