Create Windows 11 SCCM Device Collection 23H2 | 22H2 | 21H2
Using WQL queries, you can create Windows 11 SCCM device collection, such as collections for Windows 11 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. Most Configuration Manager objects, such as sites, collections, applications, and inventory data, can be returned by queries. 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, 23H2. Windows 11 (23H2) is the latest update by Microsoft and comes with lots of new features and improvements. Read what’s new in Windows 11 23H2 version.
Windows 11 will be available as a free download for existing Windows 10 users. So Windows 10 users can upgrade to Windows 11. You can refer to the following guide to upgrade Windows 10 to Windows 11 using Intune.
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 versions and build numbers that have been released by Microsoft so far.
Collections in Configuration Manager are groups of users or devices. After you create a collection, you can use it for tasks like managing applications, deploying compliance settings, or installing software updates.
What is 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
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 and the full operating system build number is 10.0.22631.2506.
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 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 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.
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 and the full operating system build number is 10.0.22621.51.
Finding the build number of Windows 11 22H2 is simple. Click on Start and type “About my PC” in search box and launch it. On 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
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 23H2 SCCM Query using Build Number
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
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 Windows 11 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 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 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.
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.
On the Query statement properties window, select Criteria tab. Click Show query language and enter the Windows 11 22H2 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_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.BuildNumber = "22621"
Click Next on summary window and on Completion window, click Close. Wait for a few minutes while the collection is updated. You should find all the Windows 11 22H2 computers added to your device collection.
First all thanks for the great job.
In a new sccm server I am trying to run this rule for getting back all win11 machines. When I am using the 22621 number i get nothing back. If i use 19044 (win10) works fine. If i run the cmpivot and choose to show me all systems having 22621 builld number i get the proper result.\
Any idea where the problem maybe occurs?
Cheers!
Hey Praj,
Do you have solution for the upcoming build version mass ?
Win 11 21H2 = 22000
Win 11 22H2 = 22621
Win 11 22H2.FU1 = 22622 (Feature Update 1)
I think it´s not a good idea to modify every time this “All Windows 11 ” collection?
And: How did you seperate the devices that they are not ALSO schowing in the existing Window 10 Collection?
br
Harald
You can use the like “22%” for all future versions of Win11 and simply exclude this new Win11 collection from your existing Win10 one for simplicity.
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 like “22%”
thank you Prajwal, you give me so many time the solution for my “challenges”
Thanks Praj. Doing my job for me for as long as I can remember haha
Thank you for the distinguished query versions. This is extremely helpful for precision object version targeting and it’s something I didn’t realize I needed. I appreciate your hard work! Cheers. 🙂