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-SCOMADAgent cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

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?

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 passes the result to the Repair-SCOMAgent cmdlet by using the pipe operator. The second command repairs the agent named server01.contoso.com.

PS C:\> Get-SCOMAgent -DNSHostName "server01.contoso.com" | Repair-SCOMAgent

Get-SCOMRunAsAccount

Get-SCOMAgent

Get-SCOMManagementServer

Uninstall-SCOMAgent

Install-SCOMAgent