In this article I will show you how to create a device collection in SCCM and I will cover all the ways you can add members to the collection.
I will also give you my top tips in creating device collections such as how you can use powershell to automate most of the heavy work.
In this article you will learn the following.
- 1 What Is A SCCM Device Collection?
- 2 How To Create A Device Collection In SCCM
- 3 How To Add Multiple Devices To A Device Collection
- 4 How To Create A Device Collection With a Query Rule
- 5 How To Create A Device Collection With Include & Exclude Rule
- 6 How To Use Limiting Collections
- 7 How To Configure Incremental And Full Updates
- 8 Best Practices For Creating Device Collections
- 9 Avoid Frequent Device Collection Updates
What Is A SCCM Device Collection?
A SCCM device collection is a group of SCCM devices or users. The SCCM group is exactly the same as an active directory group apart from it can only be used in SCCM.
There are four methods that you can use to configure the members of the group which include
Direct Rule
A direct rule is when you add a single device or user to a device collection. This can be done manually in the ConfigMgr console, or in bulk using powershell which I will show you later in this article.
Query Rule
You can use a SQL query rule to include all devices with a certain criteria such as
- Include SMS_R_SYSTEM.Name LIKE WINDOWS% = Include all devices starting with WINDOWS
- Include SMS_R_SYSTEM.Name LIKE %VM% = Include all devices that have VM in their name
- Include SMS_G_System_OPERATING_SYSTEM.Caption LIKE %Windows 10% = Include all machines with Windows 10 OS
Include Rule
Include members in another SCCM device collection in this collection
Exclude Rule
Exclude members in another SCCM device collection in this collection
How To Create A Device Collection In SCCM
Below I will start off by showing you how to create a basic device collection
- Open ConfigMgr
- Go to \Assets and Compliance\Overview\Device Collections (Here it will show all the currently created device collections)
- If you have a large environment I recommend to create device collections within folders to make it easier to find device collections. By default I always create the following folders. Devices, Deployments, Software Updates
- To create a folder right click on Device Collections in the left menu, then select Folder > Create Folder
- To create a device collection click on “Create Device Collection” in the top menu
- A wizard will now appear as shown below
- First enter a name for the collection. Make sure to give it a good descriptive name, With all environments I have managed they have had 100’s of device collections, giving it a good name will help you to find it later when you need it. I typically will give it a name such as
Device | UK Windows 2016
Device | UK Windows 2022
Device | USA Windows 2016
Software Update | Week 2 Day 3
Deployment | Adobe Reader 64 Bit - Now we need to select a limiting collection, click browse and select “All Systems” then ok (More on Limiting Collections Later In This Article)
- Click Next
- Select Add Rule > Direct Rule
- click next
- In the value field enter the name of the device you want to add to the collection
- Click next
- On the next screen your device should show, tick the box next to the device you want to include and hit next
- Click Next
- Click Close
- Now verify the correct device is showing under membership rules
- If you want to add more devices in to the collection you can click add rule and repeat steps 10 – 16
- Leave incremental updates and update scan as default (More info on these settings below)
- Click Next
- Click Next
- Click Close
- You will now see your created device collection under the Device Collections
- Below you can see I just created “Devices | UK Test Windows 2016” the limiting collection is all systems and it has 1 member
How To Add Multiple Devices To A Device Collection
There are two main ways to add multiple devices to a device collection
- Manually via the ConfigMgr console | I recommend if adding 1-10 devices
- Automated with Powershell | If adding 11 or more devices
Manually via the ConfigMgr console
To add multiple devices via the ConfigMgr Console follow these steps
- Open ConfigMgr
- Go to \Assets and Compliance\Overview\Device Collections
- Right click on the device collection you want to add members to
- Click add resources
- In “Name String Contains” enter part or all of the device name you want to search for
- Click the search button
- The results will be shown under search results
- highlight the devices you want to add and click add
- The devices will appear under selected resources
- Repeat steps 5 – 8 as needed
- Click ok
- In the console it will not show the new added devices strait away (Only 1 device showing as per the screenshot below)
- You can either wait a few minutes or you can force an update by doing the following
- Right click on the device collection
- Click update membership
- Wait 10 seconds
- Right click on the device collection
- Select Refresh
- The new added devices will now show
Automated with Powershell
If you have a list of devices you need to add to an SCCM collection you can use powershell to speed up the process. To do this follow these steps
To bulk add devices in to a sccm device collection follow these steps
- Log on your ConfigMgr server
- Create the file C:\Devices.txt and put the devices in the file that you want to add to the collection
- Open the ConfigMgr console
- Open “Windows Powershell ISE” via the ConfigMgr tool bar
- Powershell ISE will now open, Enter the below code at the bottom of the powershell window
- Get-Content “C:\Devices.txt” | foreach { Add-CMDeviceCollectionDirectMembershipRule -CollectionName “Collection Name” -ResourceID (Get-CMDevice -Name $_).ResourceID }
- Replace Collection Name with the name of the device collection you want to update
- Click Run
- If all went ok you should not see any errors or updates as shown above
If you are looking to create and update lots of device collections check out this article I wrote about how to automate this with powershell.
How To Create A Device Collection With a Query Rule
You can populate an SCCM device collection with a query rule which is useful if you have a group that is constantly changing.
For example at my company we are migrating from windows 2008 to windows 2016, Instead of manually updating my “Devices | Windows 2016” device collection I can configure it to add any devices that have windows 2016 installed on them. Below I will show you how I created this device collection to only show windows 2016 devices.
To create a device collection with a query rule follow these steps
- Open ConfigMgr
- Go to \Assets and Compliance\Overview\Device Collections
- Click “Create Device Collection” in the top menu
- Enter a name for the collection
- Select a limiting collection, click browse and select “All Systems” then ok
- Click Next
- Select Add Rule > Query Rule
- click next
- Give the query rule a name, in the example below I added “Windows 2016 Devices”
- Click Edit Query Statement
- To add the query you need to add a SQL query, You can get the query you need in this article I wrote about Query Rules
- Click the criteria tab
- Click the Show Query Language button
- Paste the query under Query Statement
- To confirm the query statement is correct hit the play button
- A new window will pop up, hit run
- Verify the Rows Returned is what you expect to see
- Click Ok
- Click Ok to close the query window
- Confirm your membership rule appears with a type of query
- Click Next
- Click Next
- Click Close
- Confirm the correct number of devices are showing in the device collection, If it is not perform the next few steps
- Click update membership
- Wait 10 seconds
- Right click on the device collection
- Select Refresh
How To Create A Device Collection With Include & Exclude Rule
Creating a device collection with a include rule is basically adding groups of devices to a device collection. You can then add an exclude group to exclude the devices in that collection.
In the below example I want to create a device collection with the following details
- All Systems That Were Created In The Last 14 Days
- That Are Not Windows Server 2008 Machines
To create a device collection with include and exclude rules follow these steps
- Open ConfigMgr
- Go to \Assets and Compliance\Overview\Device Collections
- Click “Create Device Collection” in the top menu
- Enter a name, in my example I will use “Devices | Created Last 14 Days Not Windows 2008”
- Limiting Collection select “All Systems” as this will query all systems
- Click Next
- Click Add Rule then click include collections
- Tick the box next to the collections you want to include. If you want to create a device collection that shows you new machines take a look at this article
- Click Ok
- The device collection will now show us all the machines that were created in the last 14 days, including windows server 2008 machines
- Next click on exclude collections
- Tick the box next to the collection you want to exclude
- Click ok
- Review the Membership rules
- Click Next
- Click Next
- Click Close
- To view the devices in this device collection right click on it and select show members
- In the device collection I just created you can see that 19 Windows 2016 machines have been created
- You can see one device is inactive, you could add an exclude rule to exclude inactive clients which will give you a more accurate result
How To Use Limiting Collections
When you create any type of device collection you need to specify a limiting collection. A limiting collection will limit the devices that you can add to your device collection.
For example if I set the limiting collection to “Windows 2016 Machines” Only windows 2016 machines can be added to the collection.
To set the limiting collection on a sccm device collection do the following.
- Open ConfigMgr
- Go to \Assets and Compliance\Overview\Device Collections
- If creating a new device collection, click create new device collection, then click browse next to Limiting Collection
- If editing an existing collection then right click on it and select properties, then click browse next to Limiting Collection
- Tick the box next to the collection you want to exclude
- Click ok
- Click ok
How To Configure Incremental And Full Updates
After you create a device collection SCCM will constantly update the collection with incremental and full updates. It is very important to understand what the difference is between them and how to configure them.
Incremental Updates
An incremental update uses a collection evaluation graph to evaluate and update collections. It is recommended to only enable this option to device collections that need to update frequently and do not enable on more than 200 device collections as this will affect performance of the ConfigMgr server.
It is recommended to only apply incremental updates on the following types of device collections
- Security
- Client Settings
- Software Update / Maintenance Windows
To enable incremental updates on a device collection do the following
- Open ConfigMgr
- Go to \Assets and Compliance\Overview\Device Collections
- Right click on a device collection and select properties
- Click the Membership Rules tab
- Tick the box “Use incremental updates for this collection”
- Click ok
Full Updates
A full collection by default runs once a week and it will evaluate the device collection as well as the limiting device collection used.
It is recommended to keep the full update to a week or more as anything more frequent will put more strain on the ConfigMgr server and could cause performance issues.
To change a full update schedule do the following.
- Open ConfigMgr
- Go to \Assets and Compliance\Overview\Device Collections
- Right click on a device collection and select properties
- Click the Membership Rules tab
- Click on schedule
- Change the schedule as required
- Click Ok
- Click Ok
Best Practices For Creating Device Collections
There are many best practices that I apply when creating and maintaining device collections. Below is a list of things I do
Use Good Descriptive Names
It is important to use good descriptive names for your device collections so you can easily find them as your environment grows. For this I do two things
The first thing I do is create folders and place the device collections in these folders. Typically I will create folders for
- Device Specific
- Deployments
- Software Updates
- Retired Collections
Below is a screenshot of what I have done in the environment I look after.
Give the device collection itself a good descriptive name such as
- Device | UK Windows 2016
- Device | UK Windows 2022
- Device | USA Windows 2016
- Software Update | Week 2 Day 3
- Deployment | Adobe Reader 64 Bit
Avoid names such as “Testing Deployment” “Software Update Group” and so on.
Avoid Frequent Device Collection Updates
If you have 100’s of device collections this can have an impact on the system if they are set to update frequently.
Incremental updates should only be enabled on device collections you need to update frequently and it is recommended not to enable incremental updates on more than 200 device collections.
Full updates should be configured to run once a week, Choose a time when your sccm server is not busy processing requests.
Hello, I am the owner of this site. I have 25+ years experience of IT. Check us out on the below social platforms.