Wednesday, February 17, 2010

What Management Server do my Gateway servers report to?

If you have a rather large environment, troubleshooting where a problem lies can be quite tricky. It can originate at a Gateway Server, Management Server, etc.

SCOM doesn't provide an easy way to see where a Gateway Server reports to. In our environment, we have around 20 Gateway servers and trying to keep track of what reports where is a nightmare.

I knew there would be a way in Powershell, so I started playing around.

I eventually got this right. Here's the Powershell - it'll export the results to c:\ms.csv

------

$collection = @();
foreach($gatewayServer in Get-GatewayManagementServer)
{
$info = "" | Select GatewayServerName, ReportsToServer
$info.GatewayServerName = $gatewayServer.Name
$info.ReportsToServer = $gatewayServer.GetPrimaryManagementServer().DisplayName
$collection += $info;
}
$collection | Export-Csv c:\ms.csv

No comments:

Post a Comment