Following up on my post about Using PowerShell To Add Owners For Cluster Disks here’s another quick post on how PowerShell can help you with your clusters.
In my new cluster build out I needed to quickly set it so that one of the SQL instances could only potentially live on two of the 5 nodes. This could have been quickly done using the GUI however it’s just as fast to do so using PowerShell.
Load up the Windows PowerShell Modules and you’re ready to go.
In this example we have a two node cluster made up of SERVER1 and SERVER2 and a single installed SQL instance called INST1.
In PowerShell the following would provide us a list of possible owners of INST1:
Get-ClusterOwnerNode -Group "SQL Server (INST1)"
ClusterObject OwnerNodes
————- ———-
SQL SERVER (INST1) {server1, server2}
Now to change this so that only SERVER1 can potentially own the SQL instance is a very quick task:
Set-ClusterOwnerNode -Group "SQL Server (INST1)" -Owners SERVER1
Sadly you don’t get any feedback that the change has been made, but if you run Get-ClusterOwnerNode again:
Get-ClusterOwnerNode -Group "SQL Server (INST1)"
ClusterObject OwnerNodes
————- ———-
SQL SERVER (INST1) {server1}
Adding SERVER2 back is as quick as running Set-ClusterOwnerNode again and providing a comma delimited list of servers:
Set-ClusterOwnerNode -Group "SQL Server (INST1)" -Owners SERVER1,SERVER2
ClusterObject OwnerNodes
————- ———-
SQL SERVER (INST1) {server1, server2}
You have to love the simplicity of working with clusters in PowerShell.


