Most of the organizations are using Dynamic collections to deploy applications. If you ask me whether dynamic collections are best for your SCCM environment, my answer would be no. I would rather avoid creating SCCM dynamic collection and use Active Directory group.
SCCM Education Posts
- Walkthrough of SCCM Console
- How to Promote Pre-Production SCCM Client to Production
- What is Collection, How to Create SCCM Static Collections
- How to create dynamic collections? (this post)
- Create AD Group Based SCCM Collection
I would recommend reading this post to know more about the basics of collections, best practices, and how to create static collections. In this post, we will go through how to create dynamic collections, how to organize collections, and some best practices. Also, I have uploaded a video tutorial with an audio explanation to explain all those points.
How to Organize Collections?
Why do you need to organize collections? First of all, many admins create two(2) unique collections for each application. One for installation of the application and the other one is for the uninstallation of the application. I don’t recommend creating two (2) collections for each app deployment (update:- more details in Microsoft blog post). With this kind of practice, you will end up with many collections, and you need to organize collections to manage better.
You can create collection folders to organize collections to tidy up the SCCM environment. You can have folders and subfolders to have better management of collections. I don’t think creating loads of folders will impact the performance of your environment. You can create Collection folders based on deployments. One example is given below:-
Video Tutorial – How to SCCM Dynamic Collection?
How to Create Collection Folders and Move Collections
To create SCCM collection folders follow the steps:-
- Right click on Device or User Collections
- Select Folder
- Enter the Folder Name “Default Collections” (as you can see in the video tutorial)
- Click OK button
The points mentioned in the picture are just for pictorial representation of the steps, and it’s not the same as the steps mentioned above.
How to Move Collections to Folders?
To organize collections, we need to move the collections to different folders and between the folders. How do you move the collections to folders? Follow the steps below:-
- Select the collections which you want to move
- Right Click on those selected collections
- Select the Move button on right click menu
- Select the Folder from “Move Selected Items” windows
- Click OK to complete the move of the collections to a particular folder
How to Create SCCM Dynamic Collection and Dynamic WQL Query?
As I explained in the Video tutorial, you need to use a Query rule to create a dynamic collection. In the following sections, I will teach how to create an SCCM dynamic Collection. You can use the same method to create SCCM dynamic Device collection and dynamic User collection.
- Navigate to SCCM console – Assets and Compliance – User Collections
- Right-click and select “Create User Collection” from User Collections node
- On the General page provide a Name and a Comment. Then, in Limiting collection, choose to Browse to select a limiting collection. The collection will only contain members from the limiting collection.
- On the Membership Rules page of the Create User Collection Wizard, in the Add Rule list, select the type Query Rule membership rule for this collection. You can configure multiple rules for each collection.
- On the Membership Rules page of the Create User Collection Wizard, in the Add Rule list, select Query Rule.
- On the Query Rule Properties windows, specify the following information: 7-16 steps.
- Name: Specify a unique name (my query name = User Name Starts with Anoop).
- Resource class: Select the type of resource you want to search for and add to the collection. You have to select User Resource to create Dynamic User Collection in SCCM.
- Click Edit Query Statement to Opens the Query Statement Properties dialog box where you can create a query to use as the rule for the SCCM dynamic collection.
- On Query Statement Properties click on Criteria tab.
- On Criteria Properties dialog box Criteria value as Simple Value.
- On Criteria Properties dialog box click on Select button to open Attribute Dialog box.
- On Attribute Dialog box Select Attribute class as User Resource, Alias as = No Alias, and Attribute as Name. Click OK to close Select Attribute Dialog box.
- On Criteria Properties dialog box select Operator “is like“. Is Like is not the operator which gives you best performance.
- On Criteria Properties dialog box specify Value as “Anoop%” to create a dynamic user collection with user names starting with Anoop.
- Click OK OK OK to to close all dialog boxes.
- On Membership Rule page click on NEXT.
- Click NEXT NEXT and Close to finish Create User Collection Wizard.
Best Practices – Dynamic Collections
- Try to avoid wildcard (%) in WQL Queries used in dynamic collections wherever possible
- Try to avoid OR conditions in WQL Queries used in dynamic collections wherever possible
- Direct Collection Rules have disadvantages as well. More details in Rogers post in resources section
- Check and evaluate your collections with Collection Evaluation Viewer tool https://www.anoopcnair.com/collection-evaluation-viewer
- Best practices for collections in Configuration Manager
- Introduction to collections in SCCM – here
- Create SCCM Static Collections (Programmatically or using script) – here
- Best Practices of Collection by Roger – here