Export (0) Print
Expand All
Expand Minimize

Set-SCOMParentManagementServer

Updated: January 26, 2014

Applies To: System Center 2012 R2 Operations Manager

Set-SCOMParentManagementServer

Modifies the primary and failover management servers for an agent or gateway management server.

Syntax

Parameter Set: FromAgentPrimaryServer
Set-SCOMParentManagementServer [-Agent] <AgentManagedComputer[]> [-PrimaryServer] <ManagementServer> [[-PassThru]] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: FromAgentFailoverServer
Set-SCOMParentManagementServer [-Agent] <AgentManagedComputer[]> [-FailoverServer] <ManagementServer[]> [[-PassThru]] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: FromGatewayFailoverManagementServer
Set-SCOMParentManagementServer [-GatewayServer] <ManagementServer[]> [-FailoverServer] <ManagementServer[]> [[-PassThru]] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: FromGatewayManagementServer
Set-SCOMParentManagementServer [-GatewayServer] <ManagementServer[]> [-PrimaryServer] <ManagementServer> [[-PassThru]] [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

The Set-SCOMParentManagementServer cmdlet modifies the primary and failover management servers for an agent or gateway management server. In System Center 2012 – Operations Manager, primary and failover management servers provide redundancy for agents and gateway management servers.

This cmdlet requires an agent object or a gateway management server object, and a management server object. For information about how to get an agent object, type Get-Help Get-SCAgent. For information about how to get a gateway management server object, type "Get-Help Get-SCOMGatewayManagementServer".

Parameters

-Agent<AgentManagedComputer[]>

Specifies an array of agent objects. To obtain an AgentManagedComputer object, use the Get-SCOMADAgent cmdlet.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-FailoverServer<ManagementServer[]>

Specifies an array of management server objects for the agent to use as failover servers. For information about how to get a management server object, type "Get-Help Get-SCManagementServer".


Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-GatewayServer<ManagementServer[]>

Specifies an array of gateway management server objects. For information about how to get a management server object, type "Get-Help Get-SCOMGatewayManagementServer".


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-PassThru

Indicates that the cmdlet creates or modifies an object that a command can use in the pipeline. By default, this cmdlet does not generate any output


Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-PrimaryServer<ManagementServer>

Specifies an array of management server object for the agent to use as its primary server.


Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Set primary and failover management servers

This example sets the primary and failover parent management servers.

The first two commands use the Get-SCManagementServer cmdlet to get a management server to set as the agent's primary management server, and a management server to set as the agent's failover management server. The commands store the objects in the $PrimaryMgmtServer, and $FailoverMgmtServer variables, respectively.

The third command uses the Get-SCAgent cmdlet to get the agent named Server01.Contoso.com and passes the result to the Set-SCOMParentManagementServer cmdlet by using the pipeline operator. The command sets the primary and failover management servers specified in the $PrimaryMgmtServer and $FailoverMgmtServer variables. It then uses the PassThru parameter to generate an object. Without the PassThru parameter, Set-SCOMParentManagementServer does not generate any output.


PS C:\> $PrimaryMgmtServer = Get-SCManagementServer -Name "MgmtServer01.Contoso.com"
PS C:\> $FailoverMgmtServer = Get-SCManagementServer -Name "MgmtServer02.Contoso.com"
PS C:\> "Server01.Contoso.com" | Get-SCAgent | Set-SCOMParentManagementServer -PrimaryServer $PrimaryMgmtServer -FailoverServer $FailoverMgmtServer -Passthru

Example 2: Set gateway primary server and failover server

This example sets the gateway, primary, and failover parent management servers.

The first two commands use the Get-SCManagementServer cmdlet to get a management server to set as the gateway server's primary management server, and a management server to set as the gateway server's failover management server. The commands store the objects in the $PrimaryMgmtServer, and $FailoverMgmtServer variables, respectively.

The third command uses the Get-SCOMGatewayManagementServer cmdlet to get the gateway management server named GatewayMgmtServer01.Contoso.com and pipes the result to the Set-SCOMParentManagementServer cmdlet to set the primary and failover management servers specified in the $PrimaryMgmtServer and $FailoverMgmtServer variables for the gateway management server.


PS C:\> $PrimaryMgmtServer = Get-SCManagementServer -name "MgmtServer01.Contoso.com"
PS C:\> $FailoverMgmtServer = Get-SCManagementServer -Name "MgmtServer02.Contoso.com"
PS C:\> "GatewayMgmtServer01.Contoso.com" | Get-SCOMGatewayManagementServer | Set-SCOMParentManagementServer -PrimaryServer $PrimaryMgmtServer -FailoverServer $FailoverMgmtServer

Example 3: Set primary management server

This example sets the primary management server for the specified agent.

The commands in parentheses, which are executed first, get the agent named Server01, and the management server named MgmtServer01. The cmdlet then passes the results of the commands in parentheses to the Set-SCOMParentManagementServer cmdlet, which then sets the primary server for the agent.


PS C:\> Set-SCOMParentManagementServer -Agent (Get-SCAgent -Name "Server01.Contoso.com") -PrimaryServer (Get-SCManagementServer -Name "MgmtServer01.Contoso.com")

Related topics

 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft