SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Powershell script to interactively move cluster resources

By Rolando Hernandez,

Every time Microsoft releases an important security OS patch I have to apply the same to some 16 clusters (32 nodes), even thouhg I have order list to patch the servers it becomes somehow complex to log on each node and failover/failback the nodes or the cluster resource groups.  

So that I wrote this script to interactively move the resource between cluster nodes, this has added the value of logging each step and also confirmation of what pieces need to go where.

This is how to do it:

1.- Create a file list called "clusterlist.txt" and place it in the same folder as the script is.   This file should contain the clusters virtual names to work on.

2.- Please enable delegation execution by using the following command :  

enable-wsmancredssp -role client -delegatecomputer server.windowsdomain.com

See screenshot below of illustrative issue when the previous feature is not enabled.

3.- Once CreSSP is enabled execute the script from powershell like:

powershell.exe -command ".\clustermove.ps1"

4.- It will read the list of clusters from the file, if this does not exists, will read the cluster list from the active directory.   You need to have read permissios to browse cluster names, from your AD or network.

5.- Follow interactive instructions on moving resource groups between nodes.

Note : When the options of "move all resource groups at once", they will be moved to the next available node.  When choosing a particular group, you will get the list of nodes available so that you can select where to put the resource.

Total article views: 589 | Views in the last 30 days: 1
Related Articles

Clustering - Resource settings for 'Affect the group'

Recommendations for the difference Cluster resources


Deleted SQL resources from a Cluster Resource Group

Add back the deleted recources in a cluster group


Cluster missing SQL Server Resources

Cluster missing SQL Server Resources


Combining AlwaysOn Groups With Failover Cluster Instances

This article discusses failover cluster instances and AlwaysOn groups


SQL Server Cluster : which groups should hold the Physical disk ?

"MSDTC Group" ? "Cluster Group" ? Or "SQL Cluster" Group ?

resource groups    
sql server 2012    
windows 2012