To manage SQL Server failover cluster Instances and Always ON availability groups, you will need a Windows server failover cluster (WSFC). Windows Server tool called failover Cluster manager is used to manage Windows Server failover cluster. Using the failover cluster manager, you can manage the cluster very easily and efficiently and can easily perform different tasks like configure quorum, add new nodes to the cluster, failover the cluster group/resources to another node, add new disks, and much more. But sometimes if you are facing issues with the failover cluster manager and you are unable to connect to the cluster using the failover cluster manager, you will need to manage the failover cluster using the command line.
In this article, we will share with you some basic but useful PowerShell commands to manage Windows Server failover cluster. You will need Windows PowerShell application to execute those commands.
How to Open Failover Cluster Manager from Command line
There are multiple ways to launch failover cluster manager, but to launch it using a command line, type “Cluadmin” in the PowerShell command prompt and execute it. This command will open the failover cluster manager.
Failover Cluster manager will open after executing the above mentioned command.
How to show the Cluster name using command line
To find the cluster name using command line, type “Get-Cluster” in the PowerShell command prompt. This will return the cluster name.
How to list all Nodes in the failover cluster from Command line
To list all nodes in the failover cluster, execute the Powershell command “Get-ClusterNode” in the Powershell command prompt. This will display all the nodes added in the Windows failover cluster along with their ID and State as shown in the below screenshot.
How to list all Cluster groups of Windows failover cluster using command line
To check all the Cluster Group state in the failover cluster, type “Get-ClusterGroup” in the PowerShell command prompt and press Enter. You will get the name of the cluster group, name of the owner node, and the state of that cluster group.
How to list all Cluster Resources using Command line
To list Cluster resources using command line, execute the “Get-ClusterResource” PowerShell command in the Powershell command prompt. This will return all the resources with their Name, State, Ownergroup (the group they belong to), and the resource type as shown below.
How to list all Cluster Network using command line
Execute the “Get-ClusterNetwork” PowerShell command to list all Cluster Network details in the Windows Server failover cluster.