Exchange 2010 DAG Cluster Health Check


exchangelogo

I’ve created a few Powershell scripts to help with my DAG, but this one is a great assist when patching host machines. Save the below as a .ps1 file and run from within an Exchange Management Shell.

 

# Import the FailoverClusters PowerShell module
# Needed to run the get-clustergroup command
# Must run each time a new shell is opened
write-host Importing FailoverClusters module, please wait...
import-module failoverclusters
write-host
write-host ------------------------------------------
# Lists the PAM server
write-host -nonewline PAM AND SERVERS IN MAINTENANCE...
get-databaseavailabilitygroup -status | fl name,primaryactivemanager,serversinmaintenance
write-host ------------------------------------------
# Lists server with active cluster group
write-host -nonewline CLUSTER GROUP OWNER...
get-clustergroup | ? {$_.State -eq "online"} | fl name,ownernode,state
write-host ------------------------------------------
# Lists server with active database
write-host -nonewline MOUNTED DATABASE LOCATION...
get-mailboxdatabase | fl server,name
write-host ------------------------------------------
# Lists mailbox, mailbox copy and index status
write-host -nonewline DATABASE INDEXING STATES...
get-mailboxdatabasecopystatus *\* | fl name,activedatabasecopy,*index*
write-host ------------------------------------------
# Lists status of replication between cluster servers
write-host CLUSTER HEALTH...
test-replicationhealth
write-host
write-host
write-host ------------------------------------------
# Lists details of any queue with more than 5 messages
#write-host QUEUE STATUS...
#get-transportserver | get-queue | ? {$_.messagecount -gt 5}