Repair-SCOMAgent

Repair-SCOMAgent

Repairs Operations Manager agents.

Syntax

Parameter Set: FromAgent
Repair-SCOMAgent -Agent <AgentManagedComputer[]> [-Actionaccount <PSCredential> ] [-PassThru] [ <CommonParameters>]

Detailed Description

The Repair-SCOMAgent cmdlet repairs one or more System Center 2012 – Operations Manager agent installations.

Parameters

-Actionaccount<PSCredential>

Specifies a PSCredential object. This parameter specifies the credentials that Operations Manager uses to run the deployment task. If you do not specify this parameter or you specify a null value, Operations Manager uses the default action account of the management server for the agent.

To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Agent<AgentManagedComputer[]>

Specifies an array of AgentManagedComputer objects. This parameter specifies the Operations Manager agents to repair. To obtain an AgentManagedComputer object, use the Get-SCOMADAgentAssignment cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Aliases

none

Required?

false

Position?

named

Default Value

none

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 (https://go.microsoft.com/fwlink/p/?LinkID=113216).

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: Repair an Operations Manager agent

This command repairs an agent installation. The command uses the Get-SCOMAgent cmdlet to get the Operations Manager agent named server01.contoso.com, and pipes the result to the Repair-SCOMAgent cmdlet. The second command repairs the agent named Server01.Contoso.com.

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

Get-SCOMRunAsAccount

Get-SCOMAgent

Install-SCOMAgent

Uninstall-SCOMAgent

Get-SCOMManagementServer

Get-SCOMADAgentAssignment

Get-Credential