Create Windows 11 SCCM Device Collection 23H2 | 22H2 | 21H2

Prajwal Desai
Posted by Prajwal Desai
Create Windows 11 SCCM Device Collection | 21H2 | 22H2

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. 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, 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.

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:

Support for Windows 11 in Configuration Manager

You need at least SCCM 2107 in order 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 2107 or later, you can manage Windows 11 as client. This applies to Windows 11 versions 21H2, 22H2, and 23H2.

Support for Windows 11 in Configuration Manager
Support for Windows 11 in Configuration Manager

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 23H2 Build Number
Find Windows 11 23H2 Build Number

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.

Windows 11 Build Number
Windows 11 Build Number

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 Build Version
Windows 11 Build Version

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, type “About my PC” in the 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 22H2 Build Number
Windows 11 22H2 Build Number

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“.

Create Windows 11 23H2 SCCM Device Collection
Create Windows 11 23H2 SCCM 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.

Create Windows 11 23H2 SCCM Device Collection
Create Windows 11 23H2 SCCM Device Collection

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.

Create Windows 11 23H2 SCCM Device Collection
Create Windows 11 23H2 SCCM Device Collection

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"
Enter Windows 11 22H2 WQL Query
Enter Windows 11 22H2 WQL Query

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 23H2
SCCM Device Collection for Windows 11 23H2

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“.

Create Windows 11 22H2 SCCM Device Collection
Create Windows 11 22H2 SCCM 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.

SCCM Device Collection for Windows 11 22H2
SCCM Device Collection for Windows 11 22H2

Click Add Rule and from the drop-down select Query Rule.

Select Query Rule for Windows 11 22H2
Select Query Rule for Windows 11 22H2

On the Query rule properties window, specify a name for the query such as W11 22H2 and click Edit Query Statement.

Edit Query Statement
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.

Create Windows 11 SCCM Device Collection
Create Windows 11 SCCM Device Collection

Click Add Rule and from the drop-down, select Query Rule.

Create Windows 11 SCCM Device Collection
Create Windows 11 SCCM Device Collection

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.

Create Windows 11 SCCM Device Collection
Create Windows 11 SCCM Device Collection

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.

Create Windows 11 SCCM Device Collection
Create Windows 11 SCCM 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"
Windows 11 22H2 Query SCCM Device Collection
Windows 11 22H2 Query SCCM Device Collection

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.

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.
6 Comments