How to verify SCOM 2012 Agent Failover

#For example SCOM Agents reporting to xyz01.com SCOM gateway server

$Agents = Get-SCOMAgent | where {$_.PrimaryManagementServerName -eq ‘xyz01.com’}
$Agents | sort | foreach {
Write-Host “”;
“Agent :: ” + $_.Name;
“–Primary MS :: ” + ($_.GetPrimaryManagementServer()).ComputerName;
$failoverServers = $_.getFailoverManagementServers();
foreach ($managementServer in $failoverServers) {
“–Failover MS :: ” + ($managementServer.ComputerName);
}
}
Write-Host “”;

Advertisements