Add Membership Rule To Collection operation for Microsoft System Center Configuration Manager 2012


The Add Membership Rule To Collection operation adds a membership rule to a user or device type of collection. 

The following table describes the <items> XML elements for the Add Membership Rule To Collection operation:

Elements for the <items> XML element and adapter request for the Add Membership Rule To Collection operation

Element

Definition

Required

<operation-name>

Specifies the name of the operation: add-membership-rule-to-collection

Yes

<arguments>

Specifies a list of arguments required for this operation

Yes

<target>

Specifies the connection information for the Microsoft System Center Configuration Manager application 

Valid values: The value specified for the <target> element must be the same as that specified for the name attribute of the <config> element in the adapter configuration. 

Default value: The first configuration defined in the adapter configuration

No

<collection-id>

Specifies a string identifier for the collection where the membership rule has to be added

Yes

<query-expression>

Specifies the Windows Management Instrumentation (WMI) Query language (WQL) SELECT statement 

The results of this query are used to populate the collection.

The members or resources (users or devices) are limited by the limiting collection specified at the time of creating the collection.

Yes

<rule-name>

Specifies the name of the membership rule

Yes

The following figure shows a sample adapter request for the Add Membership Rule To Collection operation:

Sample adapter request for the Add Membership Rule To Collection operation 

 <mssccm-request>
     <operation-name>add-membership-rule-to-collection</operation-name>
     <timeout-secs>120</timeout-secs>
     <arguments>
        <target>config1</target>     
        <collection-id>PRI00033</collection-id>
        <query-expression>Select * from SMS_R_System</query-expression>
        <rule-name>Test Rule</rule-name>
     </arguments>
</mssccm-request>

The following figure shows the adapter response for the sample request:

Sample adapter response for the Add Membership Rule To Collection operation

<mssccm-response>
     <metadata>
       <status>success</status>
       <response-count>1</response-count>
     </metadata>
     <responses>
       <response>
         <metadata>
           <target>config1</target>
           <status>success</status>
           <count>1</count>
         </metadata>
         <output>
           <message>Membership rule added successfully</message>
         </output>
       </response>
     </responses>
   </mssccm-response>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

TrueSight Orchestration Content 20.18.01