Members of a Configuration Manager 2007 collection are specified by using direct rules, query rules, or both. Direct rules define an explicit resource, and query rules define a dynamic collection that is regularly evaluated based on the current state of the site. It is preferable to add collection rules to the CollectionRules property when the collection is created.
You use the SMS_CollectionRuleDirect class to define direct rules. This approach is used for resources that are static in nature. For example, if you have a limited number of licenses for a particular software application, you should use direct rules to advertise to specific computers or users.
You use the SMS_CollectionRuleQuery class to define query rules. The query that you specify must be valid (see ValidateQuery Method in Class SMS_CollectionRule Query). You can use the query to specify that the collection contains resources such as "All computers running Windows Server 2003 with at least 2 GB of RAM" or "All users in the Corporate domain." You can use the query to ensure that a program is targeted for software distribution to all computers that meet the criteria. As the site changes and the collection is re-evaluated, members of the collection are automatically added and deleted.
Rules are added to a collection by using the AddMembershipRule or AddMembershipRules methods.
See Also
Send comments about this topic to Microsoft.