Uninstall-Agent
Uninstall-Agent
Uninstalls the Operations Manager agent from managed computers.
Syntax
Parameter Set: FromAgentManagedComputer
Uninstall-Agent [-AgentManagedComputer] <AgentManagedComputer[]> [[-AgentConfiguration] <UninstallAgentConfiguration> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
Uninstalls the Operations Manager agent from managed computers.
Parameters
-AgentConfiguration<UninstallAgentConfiguration>
Specifies agent configuration information. There are no cmdlets supplied to assist you with creating the type of object that this parameter requires as a value. However, you can create and populate such an object by using New-Object if you are comfortable working with the .NET framework.
Aliases |
none |
Required? |
false |
Position? |
3 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-AgentManagedComputer<AgentManagedComputer[]>
Specifies the managed computer or computers from which to uninstall agents. You can use the results of Get-Agent to create the AgentManagedComputer objects required as values to this parameter.
Aliases |
none |
Required? |
true |
Position? |
1 |
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
Notes
- For more information, type "Get-Help Uninstall-Agent -detailed". For technical information, type "Get-Help Uninstall-Agent -full".
When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".
Examples
-------------- EXAMPLE 1 --------------
This command uses Get-Agent along with Where-Object to retrieve references to the agents to uninstall. The results are stored in the $agents variable. Next, Uninstall-Agent is used to uninstall the agents.
C:\PS>$agents = get-agent | where-object {$_.name -eq 'fabrikam.contoso.net'}
uninstall-agent -agentmanagedcomputer $agents