Jump to content


Question

So, I've ran into a bit of a conundrum. I have a large amount of domin-joined devices populated and organized in AD. I want to break them up for specific software deployments by further separating them using Device Collections in SCCM 2012. I use System Resource > System OU Name to break them down into generalized collections, but often times need to break them down further by either excluding nested OU's or only including devices with specific naming strings.

 

My conundrum is this: When creating a query that only lists machines with a specific name string I get no results listed in the collection (see example 1). Additionally, I can't seem to write a query that excludes nested OU's (see example 2). :wacko:

 

EXAMPLE 1:

select * from SMS_R_System inner join SMS_G_System_SYSTEM on SMS_G_System_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_R_System.SystemOUName = "DOMAIN/ITS/WORKSTATIONS/SUPPORT" and SMS_G_System_SYSTEM.Name like "%ISSUPPORT%"

 

 

EXAMPLE 2:

select * from SMS_R_System where SMS_R_System.SystemOUName = "DOMAIN/COMPUTER LABS" and SMS_R_System.SystemOUName != "DOMAIN/COMPUTER LABS/CLASSROOMS"

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
I use System Resource > System OU Name

 

This is a good starting point to query specific OUs in AD........can you just not include or exclude the remaining nested collections via the drop down list (the same way you use the query/direct rule) to achieve this??

Rocket Man

Share this post


Link to post
Share on other sites

  • 0

I just don't think I'm compiling the query correctly. I'm really new to WQL and I'm sure I'm simply garbling up the statement. In an effort to be more clear let me give you a scenario:

 

I have three helpdesk computers I want to single out and put in their own collection so-as to assign specific client settings (ISSUPPORT01D, ISSUPPORT02D, ISSUPPORT03D). I'm sure they could be added individually to a collection (though I have been unable to successfully setup/write a query to do so), but I think the more efficient way to proceed would be to add them to a collection based on the System > Name attribu tes using an "is like" operator and a value of "ISSUPPORT" (see image).

 

Any further assistance would be most appreciated! :)

post-9339-0-13602000-1352316074_thumb.png

Share this post


Link to post
Share on other sites

  • 0

Here is a 2007 WQL statement you could try:

 

select SMS_R_System.SystemOUName, SMS_R_System.Name from SMS_R_System inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.Name like "%ISSUPPORT%" and SMS_R_System.SystemOUName = "DOMAIN/COMPUTER LABS"

Share this post


Link to post
Share on other sites

  • 0

Place your PCs in an OU in AD.

 

Then create a new collection, query rule, the part where you are going wrong above is select the attribute class= system resource and attribute = system OU Name...then the operator should be lower case is like and then press your value button this should bring in all your OUs in AD......(make sure and run a forest and system scan before this if your new OU is only recently created otherwise it may not pick up on it).........Choose your new OU...the value should then be something like domain.local\Computers\newOU.......then just default the rest of the options........this will now query this AD OU and automatically populate the SCCM collection with systems within this OU in AD.......no need for WQL statements....let SCCM do this work for you!! :D

Share this post


Link to post
Share on other sites

  • 0

Thanks for the above. :)

 

I have acutally done that for all of my other collections. I have a wonderful list of collections based upon OUs. :D My problem arrises (and I should have been more specific) in that there are multiple machines in this OU I'm trying to pull from (ie. I'm trying to pull a subset from a specific OU). If I simply query the entire OU I get more machines than I want, that's why I'm trying to create a collection based on the machine name.

 

Additionally, are there any good resources online that list examples of SCCM WQL statements for collection creation? I appreciate your time!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.