Using PowerShell to Failover Availability Groups and WFC Cluster Nodes

This article will show you how to failover an AG to another node and then move the WFC role to the same secondary node.
 

SQL Server Availability Group Failover Steps

SQL: Moves the AG to another node. This does not make that not the active node in the cluster.

Alternately (no pun intended), you can issue this T-SQL to perform the same task on the TARGET node:

 

Windows Failover Cluster Failover Steps

WFC: Drains the current node from the role and sends it to the target node. The target node now is the active node. The original node is now paused.

WFC: Resumes the drained node. It does not make it the active owner of the role.

 

Windows Failover Cluster Failback

These steps will fail back the role to the original node before the failback. Make sure you failback the Availability Group as well with the command at the top of this page

WFC: Drains the current node from the role and sends it to the target node. The target node now is the active node. The original node is now paused.

WFC: Resumes the paused node. This does not make it the active node for the role.

REF: Move-ClusterGroup
REF: Suspend-ClusterNode
REF: Resume-ClusterNode

Views – 2126