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 21H1, 22H2. 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 22H2. Windows 11 (22H2) is the latest update by Microsoft and comes with lots of new features and improvements. Read what’s new in Windows 11 22H2 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.

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 of the examples of WMI queries used for creating device collections include:

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.

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 Windows 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 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 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 have got a new query that works, please let me know in the comments section.

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

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

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

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.

4 thoughts on “Create Windows 11 SCCM Device Collection | 21H2 | 22H2”

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

    Reply
  2. 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. 🙂

    Reply

Leave a Comment