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

<operation-name>

Specifies the operation name: uninstall-agent

Yes

<command-request>

Specifies the parent element for the command elements

Yes

<timeout-secs>

Specifies the duration after which the operation times out

Default value: 60 seconds

No

<command-parameters>

Specifies the parent element for the command parameters

Yes

<agent-managed-computer>

Specifies the search criterion used to identify a computer that has an agent installed on it

Yes

<filters>

Specifies the parent element that contains the search criterion

No

<filter>

Specifies the parent element for a single search criterion

You can specify more than one filter criterion by using multiple <filter> elements.

Conditional; required if the <filters> element is specified

<agent-prop-key>

Specifies the name of the agent's property used in the search

Conditional; required if the <filters> element is specified

<agent-prop-val>

Specifies the value of the property specified in the <agent-prop-key> element

Conditional; required if the <filters> element is specified

<operand>

Specifies the operation that is performed by using the values specified in the <agent-prop-key> and <agent-prop-val> elements

Valid values:

  • equals
  • not equals
  • matches

Conditional; required if the <filters> element is specified

<preview>

Specifies whether you want to preview the results of the operation

Valid values:

  • true: Indicates that you want to preview the results of the operation
  • false: Indicates that the operation is executed without displaying the results of the execution (default)

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>
Was this page helpful? Yes No Submitting... Thank you

Comments