uninstall-agent operation
The uninstall-agent
operation uninstalls the Operations Manager agent from the specified managed computers.
The following table describes the <items>
XML and request elements for the uninstall-agent
operation:
Adapter request elements for the uninstall-agent operation
Element |
Definition |
Required |
---|---|---|
|
Specifies the operation name: |
Yes |
|
Specifies the parent element for the command elements |
Yes |
|
Specifies the duration after which the operation times out |
No |
|
Specifies the parent element for the command parameters |
Yes |
|
Specifies the search criterion used to identify a computer that has an agent installed on it |
Yes |
|
Specifies the parent element that contains the search criterion |
No |
|
Specifies the parent element for a single search criterion |
Conditional; required if the |
|
Specifies the name of the agent's property used in the search |
Conditional; required if the |
|
Specifies the value of the property specified in the |
Conditional; required if the |
|
Specifies the operation that is performed by using the values specified in the
|
Conditional; required if the |
|
Specifies whether you want to preview the results of the operation
|
No |
The following figure illustrates a sample adapter request for the uninstall-agent
operation:
Sample adapter request for the uninstall-agent operation
<scom-request>
<operation-name>uninstall-agent</operation-name>
<command-request>
<timeout-secs>120</timeout-secs>
<command-parameters>
<agent-managed-computer>
<filters>
<filter>
<agent-prop-key>Name</agent-prop-key>
<agent-prop-val>D-13096.synapse.com</agent-prop-val>
<operand>equals</operand>
</filter>
</filters>
</agent-managed-computer>
<preview>true</preview>
</command-parameters>
</command-request>
</scom-request>
The following figure illustrates the adapter response for the sample request:
Sample adapter response for the uninstall-agent operation
<scom-response>
<metadata>
<status>success</status>
<count>1</count>
</metadata>
<commands-output>
<command-output>
<metadata>
<command>./Microsoft.EnterpriseManagement.OperationsManager.ClientShell.
Startup.ps1;uninstall-agent
-agentmanagedcomputer (get-agent -managementserver ((get-
managementserver)) | where-object {$_.Name -eq
'D-13096.synapse.com'}) -whatif</command>
<execution-milliseconds>5017</execution-milliseconds>
<exit-code>0</exit-code>
<status>success</status>
<count>0</count>
</metadata>
<output>
<line>What if: Performing operation "Uninstall-Agent" on Target "D-
13096.synapse.com".</line>
</output>
</command-output>
</commands-output>
</scom-response>
Comments
Log in or register to comment.