Get-DAGDatabaseInformation

The function: Get-DAGDatabaseInformation works in Exchange versions that a DAG (Database Availability Group) exists. From 2010 through 2019, this simple little function presents information to the end user about the status of the databases.

In the Exchange Admin Center (EAC), the GUI that is, one must click on each server and each DB to see the different values. This function just does it all for you in one single output view.

To take this task a bit further, you could schedule this to run as a scheduled task, and add some code to just send you an SMTP message the results. Considered poor mans’ monitoring, it is a good way to have a message waiting for you to read in the morning to see how the DAG is configured and running.

Once you run the function interactively:

You get three views, the first one is the name of the DB on each server with: status, copyQueueLength, ReplayQueueLength, LastInspectedLogTime, and ContentIndexState values listed:

The second view shows the name of each database and how many copies total and how many copies are in a failed state:

Lastly, the third view shows the server states and services that are: passed, failed, or in error:

You can run this anytime, if you are remote connected into an Exchange PowerShell session. I didn’t write any checks to see if that is the case or not, but you’ll get a bunch of red in the output screen if you’re not logged into an Exchange on premises service.

Why not check? Well, the question becomes, how much to check for: connected to Exchange server, Exchange_AddIn installed, PS version, PS remote properly enabled on other servers, network connectivity, server available, network firewall ports open, etc. At some point, there is an assumption that an environment is fully functional with remote PowerShell enabled and the Exchange administrator has enough tribal knowledge to perform PowerShell tasks.

It’s like making a Peanut Butter and Jelly sandwich, how many ways are possible and how perfect are the steps going to be followed? Well…assuming PS remoting into an Exchange server is possible, the function should work. I know, never ‘assume’ anything, but hey, it’ll just work, trust me. 😊

Mike