Checking Availability Group Status With Powershell

Tracy Boggiano shows off a script which checks Availability Group status of selected servers:

My favorite thing to automate using PowerShell is checking on the status of things on multiple servers.  For example, after patching your environment running a quick query to make sure the version number is the same.  In this example, we will use a cmdlet my coworker wrote in combination in my cmdlet to check the health of all the Availability Groups across our landscape or you could use it just check one.  After all I do consider myself to be an HA/DR nut.

I’ve blogged about my coworker’s Get-CmsHost cmdlet before but now he has and shared it on github so you can read more about here.

In my cmdlet I use the same code that used in the SSMS AG dashboard to check the status of my Availability Groups.

Tracy includes her cmdlet as well as several example calls.

Related Posts

Log Shipping Tests With dbachecks

Sander Stad has a bonus post in his log shipping series: We want everyone to know about this module. Chrissy LeMaire reached out to me and asked if I could write some tests for the log shipping part and I did. Because I wrote the log shipping commands for dbatools I was excited about creating […]

Read More

Digging Into dbachecks

Rob Sewell walks us through dbachecks configuration: So I can import this configuration and run my checks with it any time I like. This means that I can create many different test configurations for my many different environment or estate configurations. Yes, I know “good/best practice” says we should use the same configuration for all […]

Read More

Categories

September 2017
MTWTFSS
« Aug Oct »
 123
45678910
11121314151617
18192021222324
252627282930