HayesJupe's Blog

SCCM Collections – The basics


Probably the thing that gives SCCM most of its power (IMO) is the ability to target programs at machines with very specific properties, by using query based collections – however this is also something that we get constant emails about from our support customers.

Query based collections allow an administrator to provide any criteria that the SCCM database may hold about systems, and automatically make those systems a member of that collection.

For example, you may want to update to Acrobat Reader 9.3 on all your machines, however out in the field at the moment you have a mix of Acrobat Reader 7, 8.1, 9.2 etc and the install methods for each of these is different (this is NOT the case, im just trying to present a hypothetical example!).

Within your package, you would create an upgrade program for each possible situation, and then advertise each of those programs to a different collections – each of which we will plug in a query to in order to identify the correct clients.

General Info

  • So in order to create a collection, simply go to Computer Management | Collections
  • Right click and use the context menu to create a new collection
  • After giving the collection a name, you will be presented with the “Membership rules” screen, where you can click the Database icon, to create a new query rule
  • Give the query a name and then select “Edit query statement”
  • Select the “Criteria” tab then select the “new criteria” button (the button that looks like a star)
  • From this screen, you can enter the values in the examples below to get the desired collection membership

 

Examples of common SCCM collection queries

 Remember, any information that comes from Active Directory (such as Group or OU information) relies on AD system group discovery. So make sure you configure this discovery method correctly – otherwise you’re not going to get very far!

 Collection that identifies computers in a specific group:

Criterion Value:                Simple

Where:                                 System Resource – System Group Name

Operator:                            is equal to

Value:                                   <Group Name>

Collection that identifies computers in a specific Active Directory OU

Criterion Value:                Simple

Where:                                 System Resource – System OU Name

Operator:                            is equal to

Value:                                   <OU Name>

Collection that identifies computers in a specific Active Directory Site

Criterion Value:                Simple

Where:                                 System Resource – AD Site Name

Operator:                            is equal to

Value:                                   <AD Site Name>

Collection that identifies computers with a specific program in Add/Remove Programs

Criterion Value:                Simple

Where:                                 Add/Remove Programs – Display Name

Operator:                            is equal to

Value:                                   <Program Name>

Collection that identifies computers with a specific file

Criterion Value:                Simple

Where:                                 Software Files – File Name

Operator:                            is equal to

Value:                                   <File Name>

Collection that identifies computers of a specific hardware model

Criterion Value:                Simple

Where:                                 Computer System – Model

Operator:                            is equal to

Value:                                   <Model>

Building more complex queries

So the above examples give very basic example of how to create queries… the next step is starting to build more complex queries

Queries using and/or

Collection that identifies computers with a specific file, in a specific path of a specific version

Select “new”, then

Criterion Value: Simple, Where: Software Files – File Name, Operator: is equal to, Value:<File Name>

Then Select “new” again

Criterion Value: Simple, Where: Software Files – File Path, Operator: is equal to, Value:<File Path>

Then Select “new” again

Criterion Value: Simple, Where: Software Files – File Version, Operator: is equal to, Value:<File Version>

You will notice that each time the criteria is added with an “and” statement in-between. It should be pretty clear what this means.

These can be changed by highlighting the “and” statement and clicking the “&|” button to toggle the “and” statement to an “or” statement

Using brackets

We can also bracket statements, which allows us further power, because we can then use queries like Statement1 and (statement 2 or Statement3). To use brackets, simply select the two (or more) statements you want to bracket and select the “()” button

Using Not

A “not” statement is pretty self-explanatory, and can be used by clicking on the “!” button. An example of this could be show all computers that have an entry for C:\Program Files\Acrobat\AcroRead32.exe that isn’t file version 9.3

Using In

The “In” statement can be used along with the NOT statement in order to exclude specific items from the collection

Examples

Include all computers in Site1 and Site2:                                                Select * from SMS_R_System Where ADSiteName In (“Site1”,”Site2”)

Include all computers except for those in Site1 and Site2 :            Select * from SMS_R_System Where ADSiteName Not In (“Site1”,”Site2”)

Feeding DCM baselines into collections, so you automatically remediate non-compliant machines

So for some reason, one that doesn’t make sense to most admins, the ability to create a collection directly from a DCM  baseline isn’t built into SCCM.  Fortunately, there is a TechNet article on how to perform this function http://technet.microsoft.com/en-us/library/bb680546.aspx

I hope this article has given you a start to understanding how SCCM collections can be used to target specific machines in your environment.

7 Comments »

  1. I have to say, I have been looking for something that showed me how to do collections based upon AD Group Membership for the past 5+ hours and this has to be the simplest, most concise description I have come across. Thank you very much! Its not working for me completely for some reason yet but none of the other directions I have found are either. Not getting the collections populated even though the group shows up in the AD security groups collection.

    Comment by Dennis Aston — July 31, 2010 @ 3:19 am | Reply

  2. Got my issue Sorted. Thanks so much again! So nice for the help in this blog. That “Values” button on the Criteria box is really nice to have :)

    Comment by Dennis Aston — July 31, 2010 @ 4:54 am | Reply

    • Hey Dennis,
      glad to hear it helped you and thanks for the comment.

      Comment by hayesjupe — July 31, 2010 @ 8:05 am | Reply

  3. Thank you for the simple outline. SO many variables…so little time.

    Comment by suzanne — September 16, 2010 @ 4:02 am | Reply

    • Indeed – but it does get easier the more you use it. :-)

      Hopefully the article has got you onto the right track.

      Comment by hayesjupe — September 16, 2010 @ 7:35 am | Reply

  4. Thank you so much and it saves time for me a lot.

    Comment by FixZitNow — December 2, 2011 @ 1:38 am | Reply

  5. Thank you for this!

    Comment by Matt MN — May 24, 2012 @ 6:45 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Rubric Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 29 other followers

%d bloggers like this: