About
Pricing
Community
Teams
Start Free Trial
Log in
bibi92
asked on
3/11/2012
powershell script for moving resource cluster
Hello,
I search a powershell script for moving resource cluster in another node.
Thanks
Regards
bibi
Powershell
3
1
Last Comment
bibi92
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Joe Klimis
3/11/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
bibi92
3/11/2012
ASKER
Thanks, I know that, but I search a script for automatically failover.
bibi92
3/11/2012
ASKER
Import-Module FailoverClusters
$clustergroups = Get-ClusterGroup | Where-Object {$_.IsCoreGroup -eq $false}
foreach ($cg in $clustergroups)
{
$CGName = $cg.Name
Write-Host "`nWorking on $CGName"
$CurrentOwner = $cg.OwnerNode.Name
$POCount = (($cg | Get-ClusterOwnerNode).Owne
rNodes).Co
unt
if ($POCount -eq 0)
{
Write-Host "Info: $CGName doesn't have a preferred owner!" -ForegroundColor Magenta
}
else
{
$PreferredOwner = ($cg | Get-ClusterOwnerNode).Owne
rnodes[0].
Name
if ($CurrentOwner -ne $PreferredOwner)
{
Write-Host "Moving resource to $PreferredOwner, please wait..."
$cg | Move-ClusterGroup -Node $PreferredOwner
}
else
{
write-host "Resource is already on preferred owner! ($PreferredOwner)"
}
}
}
Write-Host "`n`nFinished. Current distribution: "
Get-ClusterGroup | Where-Object {$_.IsCoreGroup -eq $false}
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck