Let’s learn more about the SCCM collection for Co-Managed Devices. The brain of this post is the WQL query to create an SCCM (ConfigMgr) dynamic device collection for co-managed devices. You can have both static collections and dynamic collections for grouping co-managed devices.
I prefer to have a dynamic device collection to target policies/applications to co-managed devices. Well, what are co-managed devices? The Co-managed Windows 10/Windows 11 devices that are managed by both ConfigMgr (a.k.a SCCM) and Intune at the same time.
SCCM Collections are there to create a group of users or devices. The collections can help us with the typical ConfigMgr admin tasks like deploying Operating System, managing applications, deploying compliance settings, or installing patches.
Create ConfigMgr Co-Managed Dynamic Device Collection
Let’s create dynamic device collection for grouping co-managed devices from your environment.
- Navigate to SCCM console – Assets and Compliance – Device Collections.
- Right-click and select “Create User Collection” from the Device Collections node.
- On the General page provide a Name and a Comment.
- You need to be careful about Limiting collection (I don’t recommend selecting All Systems collection).
- Choose to Browse to select a limiting collection. The collection will only contain members from the limiting collection.
- Click on Next to continue.
On the Membership Rules page of the Create Device Collection Wizard, in the Add Rule list. Select the type Query Rule membership rule for this collection. You have an option to create multiple rules for each collection.
Add Rule list, select Query Rule. On the Query Rule Properties windows, specify the following information:
- Enter the Query Name: Specify a unique name.
- Resource class: You have to select System Resource to create Dynamic Device Collection in SCCM.
- Click Edit Query Statement to Opens the Query Statement Properties dialog box.
NOTE! – You can verify whether the collection query is correct or not by clicking on the Green play button. Verify SCCM Collection Query Preview Tool is always useful in this kind of scenario.
Use the WQL query from the following section (WQL Query – SCCM Collection for Co-Managed Devices) to create a dynamic device collection for Co-Managed Devices.
- Click OK, OK, OK to close all dialog boxes.
- On the Membership Rule page click on NEXT.
- Click NEXT, NEXT, and Close to finish Create device Collection Wizard.
WQL Query – SCCM Collection for Co-Managed Devices
Use the following WQL query to create an ConfigMgr dynamic device collection for Co-managed devices.
NOTE! – Try the WQL query in a testing/staging environment before trying this in a production environment.
select SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_Client_ComanagementState on SMS_Client_ComanagementState.ResourceId = SMS_R_System.ResourceId where SMS_Client_ComanagementState.ComgmtPolicyPresent = 1 AND SMS_Client_ComanagementState.MDMEnrolled = 1 AND MDMProvisioned = 1
You can see the results of SCCM Collection for Co-Managed Devices in the below screenshot. We have only two devices that are co-managed in the SCCM lab environment.
- How to create collections in Configuration Manager
- Configure a query rule for a collection
- Verify SCCM Collection Query Preview Tool | Best Tool to Analyse Collection Query | ConfigMgr