In ConfigMgr , a dynamic collection membership is based on query rules. A dynamic or query based collection can have multiple query rules and collection membership updates at each collection evaluation cycle.
In this blog post, we will discuss about collection queries for Windows 10 and later devices.
What are Collection Queries
The collection queries are WQL Query (WMI Query Language Query) which request the information from SMS Provider. The information are pulled from ConfigMgr site database by SMS provider and return the result to WQL client. WQL queries are used in query based collection to populate the collection membership dynamically.
You can find few examples and sample query based on Windows OS build versions below.
Create SCCM Collection for all Windows 11 22H2 devices
The below WQL query can be used to create a collection for all Windows 11 version 22H2 computers.
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_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = "10.0.22621"
Create SCCM Collection for all Windows 10 21H2 devices
The below WQL query can be used to create a collection for all Windows 10 version 21H2 devices.
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_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = "10.0.19044"
Create SCCM Collection for all Windows 10 Devices which OS Version is 20H2 or Earlier
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_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version <= "10.0.19042" and SMS_G_System_OPERATING_SYSTEM.Caption like "Microsoft Windows 10%"
Windows 10 / 11 Build Versions
To create a collection for other Windows 10 or Windows 11 build version, you can simply copy the above query and update the build number for respective OS version. You can find the OS build numbers details in this article : Windows 10 / 11 Operating System Build Versions
Related Posts:
- How to Create Dynamic Collection in SCCM
- Enclosure Chassis Types Value & Description | ConfigMgr | SCCM
- ConfigMgr: Maintenance Window for member of specific collection – SQL Query
- SCCM Dynamic Collection for Windows 10 / 11 Devices
- SCCM Device Collection Equivalents in Microsoft Intune for App Deployment
- SCCM Dynamic Collection Based on Device Type | Collection Queries
- SCCM Collection Based on Operating System Optional Features
- SCCM Device Collection Based on Installed Software Products & Inventoried Files
- SCCM Device Collection Based on Computer Hardware Details
- SCCM Collection Queries for Opearting System Attribute Class
- SCCM Collection Queries for System Resource (SMS_R_System) Attribute Class
- SCCM Dynamic Collection using Application Deployment Status
- SCCM Dynamic Collection Based on Configuration Baseline Compliance Status
- How to Create , View and Organize SCCM Maintenance Windows
- How to Provision Windows 10 / 11 Device using Intune and Windows Autopilot
Subscribe to Techuisitive Newsletter
Be the first to know about our new blog posts. Get our newsletters directly in your inbox and stay up to date about Modern Desktop Management technologies & news.