Serge Chegorian's System Center Blog

Serge Chegorian's System Center Blog

How to populate SCCM collection with the members of subcollection

July 18th, 2013

In some situations you may want to populate your collection with the members of all its subcollections. For example you want to assign the same maintenance window to several dynamically populated collections and to minimize the administrative overhead. If your child collection ID’s are for example ABC000A1 and ABC000A2, your parent collection query will be:

select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.ResourceId in (select ResourceID from SMS_CM_RES_COLL_ABC000A1) or SMS_R_System.ResourceId in (select ResourceID from SMS_CM_RES_COLL_ABC000A2)

Serge Chegorian's System Center Blog

Serge Chegorian's System Center Blog