In our environment, we are running Microsoft Systems Operations Manager for patching. I'm looking for powershell script to check my SQL 2012 AlwaysOn status before kicking of the patches. Here is a senario:
I have three node cluster (A,B,C) with multi subnet cluster. A and B is in Primary DC and C is in DR DC. Currently, A is a primary replica and B,C are secondary replicas. Here is a patching schedule:
3RD Weekend of the month:
2am – A
4am – B
From this schedule, it would cause SQL 2012 AlwaysOn rollover twice and we don't want that. What we really want is to have a powershell script to check and patch the 2nd Replica (B) then patch primary replica(A). In this senario, it would cause AlwaysOn to rollover only once.
Please help.
Thanks,
KongDBA