export-managementpack operation

The export-managementpack operation exports a management pack to a file.

The following table describes the <items> XML and request elements for the export-managementpack operation:

Adapter request elements for the export-managementpack operation

Element

Definition

Required

<operation-name>

Specifies the operation name: export-managementpack

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

<managementpack>

Specifies the search criterion required to filter the management pack that you want to export

Yes

<managementpack-name>

Specifies the name of the management pack that you want to export

Conditional; required if Format 3 is used

<managementpack-id>

Specifies the GUID of the management pack that you want to export

Conditional; required if Format 2 is used

<filters>

Specifies the parent element that contains the search criterion

Conditional; required if Format 1 is used

<filter>

Specifies the parent element for a single search criterion

Conditional; required if Format 1 is used

<managementpack-prop-key>

Specifies the name of the management pack property used in the search

Valid values:

  • Name, KeyToken
  • Version
  • Id
  • VersionId
  • References
  • Sealed
  • ContentReadable
  • FriendlyName
  • DisplayName
  • Description
  • DefaultLanguageCode
  • LockObject

Conditional; required if Format 1 is used

<managementpack-prop-val>

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

Conditional; required if Format 1 is used

<operand>

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

Valid values:

  • equals
  • not equals
  • matches

Conditional; required if Format 1 is used

<export-path>

Specifies the path where the management pack is exported

Yes

Note

The following naming discrepancies exist between the Microsoft System Center Operations Manager 2007 application and API:

  • The ID attribute of the application is mapped to the Name attribute of the management pack in the API.
  • The Name attribute of the application is mapped to the DisplayName attribute of the management pack in the API.



The following figures illustrate sample adapter requests for the export-managementpack operation: 

Sample adapter request for the export-managementpack operation (Format 1)

<scom-request>
  <operation-name>export-managementpack</operation-name>
  <command-request>
    <timeout-secs>120</timeout-secs>
    <command-parameters>
      <managementpack>
        <filters>
          <filter>
            <managementpack-prop-key>Sealed</managementpack-prop-key>
            <managementpack-prop-val>$false</managementpack-prop-val>
            <operand>equals</operand>
          </filter>
        </filters>
      </managementpack>
      <export-path>C:\packs</export-path>
    </command-parameters>
  </command-request>
</scom-request>

Sample adapter request for the export-managementpack operation (Format 2)

<scom-request>
  <operation-name>export-managementpack</operation-name>
  <command-request>
    <timeout-secs>120</timeout-secs>
    <command-parameters>
      <managementpack>
        <managementpack-id>66de9512-d446-f46b-bb85-197ec864f1f7</managementpack-id>
      </managementpack>
      <export-path>C:\packs</export-path>
    </command-parameters>
  </command-request>
</scom-request>

Sample adapter request for the export-managementpack operation (Format 3)

<scom-request>
  <operation-name>export-managementpack</operation-name>
  <command-request>
    <timeout-secs>120</timeout-secs>
    <command-parameters>
      <managementpack>
        <managementpack-name>Microsoft.Windows.Client.BusinessCritical</managementpack-name>
      </managementpack>
      <export-path>C:\packs</export-path>
    </command-parameters>
  </command-request>
</scom-request>



The following figures illustrate the adapter response for the sample requests: 

Sample adapter response for the export-managementpack operation (Format 1)

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command>./Microsoft.EnterpriseManagement.OperationsManager.ClientShell.
        Startup.ps1;(get-managementpack | where-object {$_.Sealed -eq '$false'})
         | export-managementpack -path 'C:\packs'</command>
        <execution-milliseconds>39078</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>0</count>
      </metadata>
      <output />
    </command-output>
  </commands-output>
</scom-response>

Sample adapter response for the export-managementpack operation (Format 2)

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command>./Microsoft.EnterpriseManagement.OperationsManager.ClientShell.
        Startup.ps1;(get-managementpack -id 66de9512-d446-f46b-bb85-
        197ec864f1f7) | export-managementpack -path 'C:\packs'</command>
        <execution-milliseconds>4844</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>0</count>
      </metadata>
      <output />
    </command-output>
  </commands-output>
</scom-response>

Sample adapter response for the export-managementpack operation (Format 3)

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command>./Microsoft.EnterpriseManagement.OperationsManager.ClientShell.
        Startup.ps1;(get-managementpack -name
         Microsoft.Windows.Client.BusinessCritical) | export-managementpack -path
         'C:\packs'</command>
        <execution-milliseconds>4859</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>0</count>
      </metadata>
      <output />
    </command-output>
  </commands-output>
</scom-response>
Was this page helpful? Yes No Submitting... Thank you

Comments