WQL Queries - Collection of collections
Main Menu
>
Tools
>
WQL Queries
Collection of collections
Create a collection of computers that is the culimantion of multiple collections based on their collection ID.
Code
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_xxxxxxx1) or ResourceId in (select ResourceID from SMS_CM_RES_COLL_xxxxxxx2) or ResourceId in (select ResourceID from SMS_CM_RES_COLL_xxxxxxx3)
Documentation
To create a collection of collections you first need to know what collections you are going to combine. Right click on the collection and select properties. Copy the Collection ID from the bottom of the screen "XYX0002" and save it somewhere. Now copy and paste the above query in to the Query editor. Notice that you will not be able to use the Query Wizard anymore. Change the SMS_CM_RES_COLL_xxxxxxx1 to match the collection id SMS_CM_RES_COLL_XYX0002 for each of your collections. Now you will have a collection of collections. If you delete the original collection it will throw an error when you wish to use this collection. Created by Matthew Hudson --------------------------------