Uninstall-SCOMAgent

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Uninstall-SCOMAgent

Uninstalls agents from agent-managed computers.

Syntax

Parameter Set: Empty
Uninstall-SCOMAgent -Agent <AgentManagedComputer> [-ActionAccount <PSCredential> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Uninstall-SCOMAgent cmdlet uninstalls agents from agent-managed computers.

Parameters

-ActionAccount<PSCredential>

Specifies the credentials under which the agent uninstall task will run. If this parameter is omitted or has a null value, the default action account of the management server managing the agent is used.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Agent<AgentManagedComputer>

Specifies one or more agent objects to uninstall. Enter a variable that represents the agents, or type a command that gets the agents.

For information about how to get agents, type Get-Help Get-SCOMAgent.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

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

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • Microsoft.EnterpriseManagement.Administration.AgentManagedComputer

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.EnterpriseManagement.Administration.AgentTaskResult

Examples

-------------------------- EXAMPLE 1 --------------------------

Description

-----------

This command gets the agent "Server01.Contoso.com" and then uninstalls it.

PS C:\>Get-SCOMAgent Server01.Contoso.com | Uninstall-SCOMAgent

-------------------------- EXAMPLE 2 --------------------------

Description

-----------

The first command gets the agent-managed computer named "Server01.Contoso.com" and stores it in the $Agent variable.

The second command uninstalls the agent stored in the $Agent variable.

PS C:\>$Agent = Get-SCOMAgent Server01.Contoso.com
PS C:\>Uninstall-SCOMAgent -Agent $Agent

-------------------------- EXAMPLE 3 --------------------------

Description

-----------

The first command gets the agent named "Server01.Contoso.com" and stores it in the $Agent variable.

The second command uninstalls the agent stored in the $Agent variable using the credentials the user is prompted for.

PS C:\>$Agent = Get-SCOMAgent Server01.Contoso.com
PS C:\>Uninstall-SCOMAgent -Agent $Agent -ActionAccount (Get-Credential)

Get-SCOMAgent

Install-SCOMAgent