Come and Check our BETA Alpha version of Powershellcenter.net
Send me your comment to Powershell@powershellcenter.com

Synopsis

Uninstalls the management agent on the specified managed UNIX or Linux computers.

Syntax

Uninstall-SCXAgent -Agent <Computer[]> [-ComputerName <string>] [-Credential <PSCredential>] [-SshCredential <CredentialSet>] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

The Uninstall-SCXAgent cmdlet uninstalls the management agent on the specified UNIX/Linux computers. The required Agent parameter specifies the target managed UNIX or Linux computers to uninstall and requires a UNIX or Linux computer object. For information about retrieving managed UNIX or Linux computers, type Get-Help Get-SCXAgent. An optional SSHCredential parameter can be specified to identify the privileged credential used for uninstallation of the management agent. If the SSHCredential is not specified, the cmdlet will attempt to use the defined privileged Run As account for the agent. This cmdlet does not return any output.

Parameters

-Agent [<Computer[]>]

Specifies one or more managed UNIX or Linux computer objects. This parameter is accepted from the pipeline.

For information about how to get a managed UNIX or Linux computer object, type Get-Help Get-SCXAgent.

Required?   true
Position?   named
Default value?  
Accept pipeline input?   true (ByValue)
Accept wildcard characters?   false

-ComputerName [<string>]

Specifies a computer to establish a connection with. The computer must be running the Operations Manager Data Access service.

Valid formats include a NetBIOS name, an IP address, or a fully qualified domain name. To specify the local computer, type the computer name, "localhost", or a dot (.).

Required?   false
Position?   named
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

-Credential [<PSCredential>]

Specifies a user account under which the management group connection will run. The default is the current user.

Type a user name, such as "User01", "Domain01\User01", or "User@Domain.com", or enter a PSCredential object, such as one returned by the Get-Credential cmdlet. When you type a user name, you will be prompted for a password. For more information, type Get-Help Get-Credential.

Required?   false
Position?   named
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

-SshCredential [<CredentialSet>]

Specifies a privileged SSH credential used to perform the agent maintenance actions. If this parameter is not specified, the cmdlet will attempt to use the defined agent maintenance Run As account for the agent.

For information about how to get an SSH credential object, type Get-Help Get-SCXSSHCredential.

Required?   false
Position?   named
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

-Confirm [<SwitchParameter>]

Prompts you for confirmation before executing the command.

Required?   false
Position?   named
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

-WhatIf [<SwitchParameter>]

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

Required?   false
Position?   named
Default value?  
Accept pipeline input?   false
Accept wildcard characters?   false

Input Type

Return Type

<void>

The output is a list of results, each representing the uninstall status for a computer:

hostname, uninstall status, description

*Description includes the details of why uninstall failed.

Notes

Examples

EXAMPLE 1

PS> $MyAgent = Get-SCXAgent -Name nx1.contoso.com $SSHCredential=Get-SCXSSHCredential -UserName userBob -SSHKey c:\keys\key.ppk -ElevationType sudo Uninstall-SCXAgent -SSHCredential $SSHCredential -Agent $MyAgent

Description

-----------

#Uninstalls the agent using a specified SSH credential.

EXAMPLE 2

PS> Get-SCXAgent -Name nx1.contoso.com | Uninstall-SCXAgent

Description

-----------

#Uninstalls the agent using the defined Run As account associated with the agent.