How it works...

In the first example, we specified a particular database to check, which returns the status of all copies of that database. In the second example, we used the -DatabaseAvailabilityGroup parameter, which returns the same information, but for all databases that are part of the DAG1 database availability group. Whichever method you use, the following is the information returned for one or more databases:

In this example, we can see that database DB01 has at least two redundant copies (IsAtLeast2RedundantCopy and AtLeast2RedundantCopy) and that there are at least two available copies (IsAtLeast2AvailableCopy and AtLeast2AvailableCopy ...

Get Microsoft Exchange Server 2016 PowerShell Cookbook - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.