Repair-SCOMAgent

Repairs Operations Manager agents.

Syntax

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

Description

The Repair-SCOMAgent cmdlet repairs one or more System Center 2019 - Operations Manager and later product version agent installations.

Note: [-NoAPM] parameter is introduced with System Center Operations Manager 1807 (This parameter is not valid with System Center 2019 Operations Manager).

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.

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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-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
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-NoAPM

This is an optional parameter introduced with System Center Operations Manager 1807 (this parameter is not valid with System Center 2019 Operations Manager), which allows you to enable or disable the installation of APM component in the agent. Use this parameter to disable APM component in the agent.

Type:SwitchParameter
Position:Named
Default value:None
Required: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
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False