Failover All Cluster Resources With Powershell
Here's a simple example showing how to manage the failover process with Powershell, making sure all resources are running on one node. First, execute the below command to show which node owns the resources.
Get-ClusterGroup -Cluster ClusterName | Format-Table -AutoSize;
Name OwnerNode State ---- --------- ----- SoStagSQL20Dtc Node1 Online SQL Server Node1 Online Cluster Group Node1 Online Available Storage Node1 Online
In this example all services are currently running on Node1. It's a simple Powershell one-liner to failover everything to another node. The following example assumes a 2 node cluster and all services will be failed over to the other node;
Get-ClusterNode -Cluster ClusterName -Name Node1 | Get-ClusterGroup | Move-ClusterGroup | Format-Table -Autosize;
All services are now running on Node2
Name OwnerNode State ---- --------- ----- SoStagSQL20Dtc Node2 Online SQL Server Node2 Online Cluster Group Node2 Online Available Storage Node2 Online If you have more than 2 nodes in the cluster you can use the -Name parameter of the [Move-ClusterGroup](http://technet.microsoft.com/en-us/library/ee461002.aspx "Windows Powershell Move-ClusterGroup cmdlet") to specify a node to move resources to. ``` Get-ClusterNode -Cluster ClusterName -Name Node1 | Get-ClusterGroup | Move-ClusterGroup -Name Node2 | Format-Table -Autosize; ``` You may also like [Powershell for Failover Clustering](http://www.youdidwhatwithtsql.com/powershell-for-failover-clustering/1060 "Powershell For Failover Clustering") [Unable to start Cluster Service on one Node](http://www.youdidwhatwithtsql.com/unable-to-start-cluster-service-on-one-node/1066 "Unable to start Cluster Service on one Node") [Cluster Network 'SAN1' is Partitioned](http://www.youdidwhatwithtsql.com/cluster-network-san1-is-partitioned/1288 "Cluster Network 'SAN1' is Partitioned")