Share via


Get-SCOMParentManagementServer

Gets the management servers to which an agent reports.

Syntax

FromAgent (Default)

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

FromGatewayManagementServer

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

Description

The Get-SCOMParentManagementServer cmdlet retrieves the management servers to which an agent reports. In System Center - 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 -ComputerName "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".

Parameter properties

Type:

AgentManagedComputer[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromAgent
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-GatewayServer

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

Parameter properties

Type:

ManagementServer[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromGatewayManagementServer
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.