Create SCCM Collection for Co-Managed Devices

Prajwal Desai
Posted by Prajwal Desai
Create SCCM Collection for Co-Managed Devices

In this article, we will show you the steps to create a SCCM collection for co-managed devices. Using a WQL query, you can create a dynamic device collection for all your co-managed devices in ConfigMgr.

In ConfigMgr, collections allow you to organize users or devices. After you create a collection, you can use it for tasks like managing applications, deploying compliance settings, or installing software updates.

Queries can return the majority of Configuration Manager objects, such as sites, collections, applications, and inventory data. You can also find Windows 11 versions using SQL and CMPivot query.

Co-management enables you to concurrently manage Windows 10 or later devices by using both Configuration Manager and Microsoft Intune. Read the following guide to enable co-management for existing Configuration Manager clients.

If you have already turned on co-management for SCCM clients, you can group the co-managed devices into a dynamic collection using a WQL query. The new co-managed devices are automatically added to the collection when the Configuration Manager discovers them.

Take a look at some examples of creating device collections for the Windows OS:

Co-management Eligible Devices

Configuration Manager has a built-in device collection known as “Co-management Eligible Devices” that lists all the devices that are eligible for co-management. You cannot delete this collection or modify it.

Co-management Eligible Devices
Co-management Eligible Devices

WQL Query for Co-Managed Devices

To group all co-managed devices into a collection in Configuration Manager, use the below WQL query.

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

The above query can be appended with two more statements that basically check if the client is MDM Enrolled and MDM Provisioned.

  • SMS_Client_ComanagementState.MDMEnrolled = 1
  • MDMProvisioned = 1

Some examples of WQL queries used for creating device collections include:

Create SCCM Collection for co-managed Devices

Let’s go through the steps to create a new device collection for co-managed computers in SCCM. First, launch the Configuration Manager console. To create a co-managed device collection, right-click the Device Collections node in the SCCM console and select Create Device Collection.

Create Device Collection for Co-Managed Devices
Create Device Collection for Co-Managed Devices

Specify the device collection name, such as “All Co-Managed Devices” or something similar. You may add a brief description of the collection. Choose the limiting collection and click Next.

Create Device Collection for Co-Managed Devices
Create Device Collection for Co-Managed Devices

On the Membership Rules window, click Add Rule and from the drop-down, select Query Rule.

Select Query Rule
Select Query Rule

In the Query Rule Properties box, enter the query name and select Edit Query Statement.

WQL Query for Co-Managed Devices
WQL Query for Co-Managed Devices

Select the criteria tab. Click Show query language and enter the below WQL query. Click OK twice.

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
SCCM Collection for co-managed Devices
SCCM Collection for co-managed Devices

On the Membership Rules screen, you’ll see the query rule that you created above. Click Next.

SCCM Collection for co-managed Devices
SCCM Collection for co-managed Devices

Click Next on the Summary window, and on the completion window, click Close. This completes the steps to create a co-managed device collection in ConfigMgr.

SCCM Collection for co-managed Devices
SCCM Collection for co-managed Devices

Collection Update

When you create a device collection or user collection in ConfigMgr, it takes a few minutes while the collection is updated. The collection will have an hourglass icon on it to show that updates are happening during this time. In the background, the WQL query that you specified is evaluated, and the objects that meet the query criteria are added to the collection.

To speed up the collection update, right-click the co-managed device collection and select Update Membership. Once the collection has been updated, you’ll find all the co-managed devices added to it.

Co-Managed Devices
Co-Managed Devices
Share This Article
Prajwal Desai
Posted by Prajwal Desai
Follow:
Prajwal Desai is a Microsoft MVP in Intune and SCCM. He writes articles on SCCM, Intune, Windows 365, Windows Server, Windows 11, WordPress and other topics, with the goal of providing people with useful information.
Leave a comment