Hello, I want to fire a script/one liner prior to patching a cluster node. I want posh to detect if its the active node. If so, move the roles, services, etc to the inactive/standby node.
As a result I can have my patch management application proceed to install/reboot, etc.
I found a few resource but it seems to do much more than I really need.
http://lifeofageekadmin.com/using-powershell-move-cluster-resources-preferred-node/
Any advise on how I can get started?
So far I have collected this but I am not sure how to further tweak it to dynamically move to the inactive node.
$TargetNode = Get-ClusterNode -cluster 'MYCLUSTERNAME' | ? {$_.State -eq 'Up' -and $_.Name -ne $CurrentNode}
Thank you.
R