Partager via


A warning about direct memberships in collections

Today’s blog post again comes from a fellow PFE and I can’t take any credit.  However, I thought it was a worthwhile topic and I wanted to make sure the knowledge and information is out there for other folks.

When you create a collection and decide to populate it you have two options, direct membership and query based.  Many folks use direct membership because it is very easy to do compared to a query.  Pick a machine, and it is in your collection.  This works fine if you are setting up a quick package test or something similar but there is a pitfall most folks are not thinking about.  When you do this you may pick a machine/user based on its name, but under the covers SCCM is actually assigning the resource based on an ID number.

Where this can come back to haunt folks is if a machine should change its ID number.  To the SCCM administrator the machine still shows in the admin console, but would no longer be a member of any collections where it was directly assigned.  A machine can change its ID number for various reasons, such as an OS upgrade (hopefully via the OSD feature), because it is accidently deleted from SCCM and then repopulates from a new DDR, or if maintenance tasks are set to aggressively and delete the current record.

The solution here is slightly more work in the short term, but can save you some work in the long run.  When you create that collection membership make it query based and in that query you can specify to return all machines/users with a specific name.  Now no matter what happens to the machine and it’s ID in SCCM it will continue to be a member of the collection as long as it keeps the same name.

One more catch, this time in relation to the solution I mentioned.  I have heard (but not witnessed myself) that collections with a large amount of queries can perform poorly.  I would suggest that rather than making one query for each machine you want you instead make a single query that is a “list of values” instead of the more standard “simple value” and then just add all your machines to that one query.

Comments

  • Anonymous
    November 21, 2010
    I never like direct memberships because they are static, I always write queries with a list of values instead so that I can add more without creating more queries. I'm glad you pointed out the drawback of direct memberships, because there are a few techs I work with that use them often and it comes back to bite them later; now I know why it is causing them problems and can convince them to stop using them so often, thanks!

  • Anonymous
    March 24, 2016
    "List of Values" query rules seem to be limited as well. When machine names are shorter (fewer characters), I see a greater number of machines that will populate the collection when it is created using a query rule that uses a list of values. Conversely, when machine names are longer (more characters), I see fewer machines that populate the collection.