Using WQL queries, you can create Windows 11 SCCM device collection, such as collections for Windows 11 24H2, 23H2, 22H2, and 21H1. Let’s look at the Windows 11 SCCM device collection creation process.
In SCCM, you can create and run queries to find objects that match your query criteria. 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.
This article lists the process to create a device collection for all the versions of Windows 11, including the latest version, 24H2. Windows 11 2024 update (version 24H2) is the latest update by Microsoft and comes with lots of new features and improvements. Read what’s new in Windows 11 24H2 version.
To group all the Windows 11 computers into one device collection in SCCM, you can create a device collection for Windows 11. The query runs on a schedule and adds new Windows 11 computers to the SCCM device collection. Take a look at all the Windows 11 builds and versions that Microsoft has so far made available.
What is a WQL query?
WMI Query Language (WQL) is a subset of SQL, meaning everything in WQL also exists in SQL. The views are also a feature of both SQL and WQL and are not unique to either. The best example is Configuration Manager collections, which are based on WQL queries.
WQL has the advantage of being able to return WMI objects as well as specific properties. WQL queries can return result sets that you can use within the ConfigMgr infrastructure because management applications such as the Configuration Manager console interact with WMI objects.
Some examples of WMI queries used for creating device collections include:
- Create Microsoft Edge Device Collection in SCCM
- Create SCCM Windows Server 2022 Device Collection
- SCCM Device Collection for DHCP Servers
- Create SCCM Device Collection for Visual Studio
Support for Windows 11 in Configuration Manager
You need at least SCCM 2211 to support it as a Windows 11 client. The below screenshot lists the versions of Windows 11 that you can use as a client with different versions of Configuration Manager.
We see that if you are running ConfigMgr 2211 or later, you can manage Windows 11 as a client. It is always recommended that you use the latest current branch version for better compatibility with Windows operating systems. This applies to Windows 11 versions 21H2, 22H2, 23H2, and 24H2.
Find Windows 11 24H2 Build Number
Windows 11, version 24H2, also known as the Windows 11 2024 Update, is available for eligible Windows 10 and Windows 11 devices. The Windows 11 24H2 operating system build number is 10.0.26100.
To determine the build number of Windows 11 version 24H2:
- On your Windows 11 PC, click on Start, type “About My PC” in the search box, and launch it.
- In the About window, under Windows Specifications, you will find the OSD build number, Windows Edition and Windows version details.
- Edition: Windows 11 Enterprise
- Version: 24H2
- OS build: 26100.2506
Find Windows 11 23H2 Build Number
Windows 11, version 23H2, also known as the Windows 11 2023 Update, is available for eligible Windows 10 and Windows 11 devices. The Windows 11 23H2 operating system build number is 10.0.22631.
Use the following steps to determine the build number of Windows 11 23H2:
- On your Windows 11 PC, click on Start, type “About My PC” in the search box, and launch it.
- In the About window, under Windows Specifications, you will find the OSD build number, Windows Edition and Windows version details.
- Edition: Windows 11 Enterprise
- Version: 23H2
- OS build: 22631.2506
Find Windows 11 22H2 Build Number
Windows 11, version 22H2, also known as the Windows 11 2022 Update, is available for eligible Windows 10 and Windows 11 devices. The Windows 11 22H2 operating system build number is 10.0.22621.
Finding the build number of Windows 11 22H2 is simple. Click on Start, type “About my PC” in the search box, and launch it. In the About window, under Windows Specifications, you will find the OSD build number, Windows Edition and Windows version details.
- Edition: Windows 11 Enterprise
- Version: 22H2
- OS build: 22621.525
Find Windows 11 21H2 Build Number
The Windows 11 (also known as Windows 11 21H2) operating system build number is 10.0.22000, and the full operating system build number is 10.0.22000.51.
The Windows 11 build number in SCCM can be retrieved under the computer properties. Go to the General tab, and under Discovery Data, look for the Operating System Build Number value.
If I run resource explorer on my Windows 11 computer, I can see the following details.
- Name: Windows 11 Enterprise
- Build Number: 22000
- Caption: Microsoft Windows 11 Enterprise
The above information should be sufficient to create create as 11 SCCM device collection.
Windows 11 SCCM Queries for Device Collection
I will list the WQL queries using which you can create a device collection for Windows 11 in SCCM. If you find a new query that works, please let me know in the comments section.
Windows 11 24H2 SCCM Query using Build Number
The below WQL query groups all the devices running Windows 11 version 24H2 into a device collection.
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.BuildNumber = "26100"
Windows 11 23H2 SCCM Query using Build Number
The below WQL query groups all the devices running Windows 11 version 23H2 into a device collection.
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.BuildNumber = "22631"
Windows 11 22H2 SCCM Query using Build Number
The below WQL query groups all the devices running Windows 11 version 22H2 into a device collection.
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.BuildNumber = "22621"
Windows 11 SCCM Query using Build Number
Use the below WQL query to create a Windows 11 device collection using the build number. Make sure you replace the build number as new versions of Windows 11 are released.
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.BuildNumber = "22000"
Windows 11 SCCM Query using Caption
Use the below WQL query to create a Windows 11 device collection using the caption “Windows 11 Pro”.
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.Caption = "Microsoft Windows 11 Pro"
Use the below WQL query to create a device collection using caption “Windows 11 Enterprise”.
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.Caption = "Microsoft Windows 11 Enterprise"
Windows 11 SCCM Query using OS Name
Use the below WQL query to create a Windows 11 device collection using the OS name.
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.Name like "%Microsoft Windows 11 Enterprise%"
Create Windows 11 24H2 device collection in SCCM
Let’s create a new device collection for Windows 11 24H2 computers in SCCM. Right-click the “Device Collections” node in the SCCM console and select “Create Device Collection“.
Specify the device collection name, for example, “Windows 11 24H2“. You may add a brief description about the collection. Choose the limiting collection and click Next.
On the Membership Rules window, click Add Rule and from the drop-down, select Query Rule. In the Query Rule Properties box, enter the query name and click Edit Query Statement.
Select the Criteria tab. Click Show query language and enter the below provided Win11 24H2 WQL query. Ensure the build number of Windows 11 24H2 entered is 26100. 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_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.BuildNumber = "26100"
Click Next on the Summary window, and on the completion window, click Close. Wait for a few minutes while the collection is updated. You should find all the Windows 11 24H2 computers grouped into the device collection.
Create Windows 11 23H2 SCCM Device Collection
Let’s create a new device collection for Windows 11 23H2 computers in SCCM. To create a device collection, right-click the “Device Collections” node in the SCCM console and select “Create Device Collection“.
Specify the device collection name, which is “Windows 11 23H2” in this case. You may add a brief description about the collection. Choose the limiting collection and click Next.
On the Membership Rules window, click Add Rule and from the drop-down, select Query Rule. In the Query Rule Properties box, enter the query name and click Edit Query Statement.
Select the Criteria tab. Click Show query language and enter the below Windows 11 23H2 WQL query. Ensure the build number of Windows 11 23H2 entered is 22631. 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_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.BuildNumber = "22631"
Click Next on the Summary window, and on the completion window, click Close. Wait for a few minutes while the collection is updated. You should find all the Windows 11 23H2 computers grouped into the device collection.
SCCM Device Collection for Windows 11 22H2
Let’s create a new device collection for Windows 11 22H2 computers in SCCM. To create a device collection, select the “Device Collections” node in the SCCM console. On the Home tab of the ribbon, select “Create Device Collection“.
On the General window of create device collection wizard, specify the name of the collection. For ex. you can specify the collection name as “Windows 11 22H2 device collection“. Click on Browse and select the limiting collection. Click Next.
Click Add Rule and from the drop-down select Query Rule.
On the Query rule properties window, specify a name for the query, such as W11 22H2 and click Edit Query Statement.
Switch to the Criteria tab. Click Show query language and enter the below provided WQL query for version 22H2. Verify the build number of Windows 11 22H2 entered is 22621. 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_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.BuildNumber = "22621"
Review the collection settings on the Summary window and click Next. On the completion window, click Close. Wait for a few minutes while the collection is updated. You should find all the Windows 11 22H2 computers grouped into the device collection.
Create Windows 11 SCCM Device Collection
Let’s create a new SCCM device collection for Windows 11 computers. To create a device collection, select the “Device Collections” node in the SCCM console. On the Home tab of the ribbon, select “Create Device Collection“.
In the General window of the Create Device Collection wizard, specify the name of the collection. Specify the collection name as “Windows 11 device collection” and select the limiting collection. Click Next.
Click Add Rule and from the drop-down, select Query Rule.
Specify the name for the query rule and click Edit Query Statement. In the Query statement properties window, select the Criteria tab. Click Show query language and enter the Windows 11 WQL query. Click OK twice.
Click Next on the Summary window, and on the completion window, click Close. Wait for a few minutes while the collection is updated. You should find all the Windows 11 computers added to your device collection.
Still Need Help?
If you need further assistance on the above article or want to discuss other technical issues, check out some of these options.