PowerShell – Roll Microsoft Print Cluster

In later releases of Microsoft’s print clustering service, moving the primary node of a cluster requires setting up dependencies correctly, otherwise, node splitting occurs.  Instead of fixing the improper cluster configuration, I wrote the following PowerShell script to roll each cluster group required to the standby node.  This script was written with a 2 node cluster in mind, so if there are more than 2 in your cluster, modification might be necessaary.  This script will only work on servers with clustering installed.

Import-Module FailoverClusters

$Nodes = Get-ClusterNode
$nodeowner = Get-ClusterGroup "PRINTCLUSTERNAME" | select ownernode
if ($nodeowner -eq $nodes[0].Name) { $clusternodename = $nodes[1].Name } else { $clusternodename = $nodes[0].Name }

Move-ClusterGroup "PRINTCLUSTERNAME" -node $clusternodename -wait 0
Move-ClusterGroup "cluster group" -node $clusternodename -wait 0
Move-ClusterGroup "Available Storage" -node $clusternodename -wait 0

Leave a Reply