Repair-SCOMAgent

Repairs Operations Manager agents.

Syntax

Repair-SCOMAgent
      [-Actionaccount <PSCredential>]
      -Agent <AgentManagedComputer[]>
      [-PassThru]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

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

Examples

Example 1: Repair an Operations Manager agent

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

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.

Required Parameters

-Agent

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.

Type:AgentManagedComputer[]
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-Actionaccount

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.

Type:PSCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
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.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False