Repair-SCOMAgent
Repairs Operations Manager agents.
Syntax
Default (Default)
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
.
Parameter properties
Type: | PSCredential |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | AgentManagedComputer[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | cf |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | wi |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.