Listing SCOM 2012/2016 Resource Pool Members

Hi Guys, I was asked today if there’s any way that we can use Windows PowerShell to list all of the members of a SCOM Resource Pool and of course yes there is. Actually a few blogs have examples of this so I’ve checked this to run on SCOM 2016 as well as SCOM 2012.

So to check a single Management Server (or Gateway), use the following PowerShell:

$ManagementServer = Get-SCOMManagementServer -Name “fqdn of your server”
$ResourcePools = Get-SCOMResourcePool -Member $ManagementServer
$ManagementServer.DisplayName
$ResourcePools.DisplayName

 

You’ll get output like this…

All Management Servers Resource Pool
Notifications Resource Pool
AD Assignment Resource Pool

 

But if you’re after a breakdown of all of your Management Servers and of course your Gateway Servers then try this PowerShell:

 

$AllManagementServers = Get-SCOMManagementServer
$ManagementServers = $AllManagementServers | ? {$_.IsGateway -eq $false}
$GatewayServers = $AllManagementServers | ? {$_.IsGateway -eq $true}

foreach ($ManagementServer in $ManagementServers)
{
write-host “”
$ResourcePools = Get-SCOMResourcePool -Member $ManagementServer
Write-Host “Management Server – “$ManagementServer.DisplayName
if (!($ResourcePools.DisplayName))
{
Write-Host “– Not a member of any Resource Pool”
}
else
{
$ResourcePools.DisplayName
}
}

foreach ($GatewayServer in $GatewayServers)
{
write-host “”
$ResourcePools = Get-SCOMResourcePool -Member $GatewayServer
Write-Host “Gateway Server – “$GatewayServer.DisplayName
if (!($ResourcePools.DisplayName))
{
write-host “– Not a member of any Resource Pool”
}
else
{
$ResourcePools.DisplayName
}
}

 

You’ll get output like this…

 

Management Server –  managementserver01.mydomain.com
All Management Servers Resource Pool
Notifications Resource Pool
AD Assignment Resource Pool

Management Server –  managementserver02.mydomain.com
All Management Servers Resource Pool
Notifications Resource Pool
AD Assignment Resource Pool

Gateway Server –  gatewayserver01.gw.internal
Unix Resource Pool

Gateway Server –  gatewayserver02.mydomain.com
— Not a member of any Resource Pool

 

 

 
Comments

No comments yet.

Leave a Reply