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 | 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 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
<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
<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>