Share This Post

ConfigMgr–Exclude Members Of Another Collection

Was working on a crazy collection query today for a client and I needed to exclude the members of another collection in addition to the other queries I had already built into the collection. Took me awhile of searching, but I finally found this post on TechNet.

This is the query:

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.Client = 1 and

SMS_R_System.ClientType = 1 and SMS_R_System.ResourceId not in

(select ResourceID from SMS_CM_RES_COLL_XXXxxxxx)

Replace the red XXXxxxxx with the CollectionID you want to use.

Share This Post

I am a Microsoft MVP for System Center Configuration Manager and owner of Nackers Consulting Services, LLC. I focus primarily on System Center Configuration Manager and the Microsoft Deployment Toolkit. In addition to helping clients leverage the technologies they use, I enjoy spending a lot of time on the forums and email lists helping answer questions and just seeing what people are doing with the deployment technologies available to them. I have spoken at Microsoft Management Summit on ConfigMgr/MDT integration and I have spoken at user groups around the country. If you have any questions, please feel free to contact me, I am always willing to help.

Leave a Reply