Get-SCOMParentManagementServer

Gets the management servers to which an agent reports.

Syntax

Get-SCOMParentManagementServer
   [-Agent] <AgentManagedComputer[]>
   [<CommonParameters>]
Get-SCOMParentManagementServer
   [-GatewayServer] <ManagementServer[]>
   [<CommonParameters>]

Description

The Get-SCOMParentManagementServer cmdlet retrieves the management servers to which an agent reports. In System Center 2016 - Operations Manager, primary and failover management servers provide redundancy for agents and gateway management servers.

Examples

Example 1: Retrieve a list of management servers

PS C:\>Get-SCOMParentManagementServer -Agent (Get-SCOMAgent -Name "Server01.Contoso.com")

This command retrieves the management servers to which the agent named Server01 reports.

The command in parentheses executes first and retrieves the agent named Server01. The cmdlet then uses the results of the command in parentheses as input to the Agent parameter.

Example 2: Retrieve a list of management servers by wildcard

PS C:\>$Agents = "Server*.Contoso.com" | Get-SCOMAgent
PS C:\> Get-SCOMParentManagementServer -Agent $Agents

This example retrieves a list of management server for agent names that match a specific string.

The first command uses the Get-SCOMAgent cmdlet to get agents that begin with the string Server with a wildcard character. The cmdlet stores the agents in the $Agents variable.

The second command uses the Get-SCOMParentManagementServer cmdlet to get the management servers in the $Agents variable.

Example 3: Retrieve a list of management server using pipes

PS C:\>"Server01.Contoso.com" | Get-SCOMAgent | Get-SCOMParentManagementServer

This command passes the agent named Server01.Consoso.com to the Get-SCOMAgent cmdlet by using the pipeline operator, and then passes the output to the Get-SCOMParentManagementServer cmdlet.

Parameters

-Agent

Specifies an array of one or more agent objects. For more information about how to get an agent object, type "Get-Help Get-SCOMAgent".

Type:AgentManagedComputer[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-GatewayServer

Specifies an array of gateway management servers. To obtain a ManagementServer object, use the Get-SCOMManagementServer cmdlet.

Type:ManagementServer[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False