Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: 455 | Views in the last 30 days: 9
 
Related Articles
FORUM

Clustering - Resource settings for 'Affect the group'

Recommendations for the difference Cluster resources

FORUM

Deleted SQL resources from a Cluster Resource Group

Add back the deleted recources in a cluster group

FORUM

Cluster missing SQL Server Resources

Cluster missing SQL Server Resources

ARTICLE

Combining AlwaysOn Groups With Failover Cluster Instances

This article discusses failover cluster instances and AlwaysOn groups

FORUM

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

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

Tags
cluster    
interactive    
powershell    
resource groups    
sql server 2012    
windows 2012    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones