The AddMembershipRule Windows Management Instrumentation (WMI) class method, in System Center 2012 R2 Configuration Manager, adds a new rule to the CollectionRules property of the SMS_Collection Server WMI Class.

The following syntax is simplified from Managed Object Format (MOF) code and defines the method.

SInt32 AddMembershipRule(
	 SMS_CollectionRule collectionRule,
	 UInt32 QueryID



Data type: SMS_CollectionRuleQualifiers: [in]SMS_CollectionRule Server WMI Class object to add.

Data type: UInt32Qualifiers: [out]Configuration Manager-generated query ID if the rule is a query rule. If the rule is direct, this ID is 0. Use QueryID to modify or delete a query membership rule.

Return Values

An SInt32 data type that is 0 to indicate success or non-zero to indicate failure.

For more information about handling returned errors, see About Configuration Manager Errors.


Runtime Requirements

Development Requirements

See Also