Create SCCM Device Collection for Windows 10 Computers

In this post, I’ll walk you through the process of creating a SCCM device collection for Windows 10 computers. Using WQL queries, you can create Windows 10 SCCM device collections, such as collections for Windows 10 versions 21H2, 22H2, 21H2, and 20H2.

In SCCM, a query is a specific set of instructions that extract information about a defined set of objects. You can create queries and store them in the Configuration Manager site database. By running a query, you search the database for information about the objects that match the query criteria.

Configuration Manager comes with just a handful of queries out-of-the-box that illustrates a small part of the rich amount of data available. Microsoft has picked 10240 as the final build number of Windows 10.

If you are managing Windows 11 using SCCM, you can also create device collection for Windows 11. Read the following guide to learn how to create Windows 11 device collections.

List of Windows 10 Versions and Build Numbers

There have been several Windows 10 versions released. Every version of Windows 10 has a unique build number, and we will utilize the build number for creating Windows 10 device collections in SCCM. The below table lists all the Windows 10 versions along with build numbers.

Windows 10 VersionWindows 10 Build Number
Windows 10 Version 22H219045
Windows 10 Version 21H219044
Windows 10 Version 21H119043
Windows 10 Version 20H219042
Windows 10 Version 200419041
Windows 10 Version 190918363
Windows 10 Version 190318362
Windows 10 Version 180917763
Windows 10 Version 180317134
Windows 10 Version 170916299
Windows 10 Version 170315063
Windows 10 Version 160714393
Windows 10 Version 150710240
List of Windows 10 Versions and Build Numbers

Create SCCM Device Collection for Windows 10 Computers

Let’s create a new SCCM device collection for Windows 10 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.

SCCM Device Collection for Windows 10 Computers
Create SCCM Device Collection for Windows 10 Computers

In the General window of the Create Device Collection wizard, specify the name of the collection. Specify the collection name as “Windows 10 device collection” or “All Windows 10 Computers” and select the limiting collection. Click Next.

SCCM Device Collection for Windows 10 Computers
Create SCCM Device Collection for Windows 10 Computers

On the Membership Rules page, click on “Add Rule” > “Query Rule.”

SCCM Device Collection for Windows 10 Computers
Create SCCM Device Collection for Windows 10 Computers

Specify the name for the query rule and click Edit Query Statement.

SCCM Device Collection for Windows 10 Computers

In the Query Statement Properties window, select the Criteria tab. Next, click on the star icon in the Query Statement Properties window to set criteria.

SCCM Device Collection for Windows 10 Computers

Select “Simple” as the criterion type. Choose the attribute class = Operating System, attribute = build number. Select the operator equal to and set the value to 10240, the Windows 10 OS build number. Click OK.

Note: You must enter the build number of Windows 10 version here. Use the table listed in the above section to enter the build number for Windows 10.

SCCM Device Collection for Windows 10 Computers

If you need the query, here it is.

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 = "10240"

After you have defined membership rules, click on Next.

SCCM Device Collection for Windows 10 Computers
Create SCCM Device Collection for Windows 10 Computers

The device collection has been created. Wait for a few minutes, and you will see all the Windows 10 computers grouped into the device collection.

SCCM Device Collection for Windows 10 Computers
Create SCCM Device Collection for Windows 10 Computers

Windows 10 SCCM Queries for Device Collection

I will list the WQL queries using which you can create a device collection for Windows 10 in SCCM. If you have got a new query that works, please let me know in the comments section.

Windows 10 SCCM Query using Build Number

Use the below WQL query to create a Windows 10 device collection using the build number. Make sure you replace the build number as new versions of Windows 10 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 = "19043"

Windows 10 22H2 SCCM Query using Build Number

Use the below query to create Windows 10 22H2 device collection in Configuration Manager.

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 = "19045"

Windows 10 21H2 SCCM Query using Build Number

Use the below query to create Windows 10 21H2 device collection in Configuration Manager.

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 = "19044"

Windows 10 21H1 SCCM Query using Build Number

Use the below query to create Windows 10 21H1 device collection in Configuration Manager.

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 = "19043"

Windows 10 20H2 SCCM Query using Build Number

Use the below query to create Windows 10 20H2 device collection in Configuration Manager.

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 = "19042"

Windows 10 SCCM Query using OS Caption

Use the below WQL query to create a Windows 10 device collection using the caption “Windows 10 Enterprise“. For Windows 10 Professional version, substitute the caption value as “Windows 10 Professional“.

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 10 Enterprise"

Windows 10 SCCM Query using OS Name

Use the below WQL query to create a Windows 10 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 10 Enterprise%"

Leave a Reply

Your email address will not be published. Required fields are marked *

27 Comments

  1. Hi there

    I am new in sccm , i would like to know once create the query , where can i locate the file

    Please kindly advice

  2. Avatar photo Jason Moran says:

    Hello Prajwal
    After following the information in this article I have found that I am not getting accurate results or perhaps I am not being patient enough. I created 2 Device Collections based on Build Numbers “19042” and “19044”, Windows 10 20H2 and 21H2 respectively. I then ran the HW and SW Inventory and Updated the Device Collection. I can confirm that at least 1 workstation in the 20H2 Collection is indeed 21H2. Any thoughts as to why?
    Jason

    1. Avatar photo Jason Moran says:

      Running HW and SW Inventory and Patience seems to have been the answer. The trouble I am trying to resolve is why some of my Workstations upgraded/updated to 21H2 while others only went to 20H2 with the same Deployment Group.

  3. Hi Prajwal,
    I accidentally deleted a device collection, is there a way to restore it?

  4. Hi.
    Thank you I have use your training several times

    David

  5. Avatar photo Sarfaraz Ansari says:

    Hello Prajwal,

    Thanks for sharing this. When I created collection with this steps it is adding Servers as well in collection.

  6. Avatar photo k.anilkamar says:

    1909 query, this one is right OR wrong please tell me sir

    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.18363” and SMS_R_System.Name like “KGIDT%”

  7. Avatar photo mike metzler says:

    Hi Prajwal,

    Thank you for all your articles. This one works great for creating collections based on the main build number, but i need to be able to differentiate between the different sub builds. When i try to build a collection based on 18363 it works, but if i try to use 18363.720 it will not return anything. The information is listed “somewhere” because i can see the full build number if viewing a collection adding the column for Operating System Build (10.0.18363.720). Ive also tried using that full build number without result. Could you point me in the right direction?

    Thank you!

  8. sir

    can share the detail what is collection and different type of collection how its created

      1. Avatar photo madhan kumar says:

        please let me about this

  9. This will list all of the windows 10 devices. Doest matter which verson.

    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 where
    SMS_R_System.OperatingSystemNameandVersion like “%Workstation 10.0%”

  10. Avatar photo ussername says:

    helpful, but this query also returns server 2019 machines. need to add a producttype check. 1 = workstations, 2 = domain controllers, 3 = member servers

  11. Avatar photo Matthew Martyn says:

    I find that the query you showed us on here leaves too many Windows 10 PCs not joining a device collection. For example, I created a query for 1809 using yours and only about 2/3 of my PCs will join the DC. Why, I have NO idea. My guess is that SCCM is not getting the information that the query is wanting. Instead I use the following query and have had 100% success using it. It can be adjusted to detect other builds of Windows 10 by altering the Build Number to match what you want SCCM to find.

    1. Avatar photo Tylor Faoro says:

      You can add OR queries for each build number in your tree which will allow you to search for all respective Builds. My Query is:

      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 = “17763” or SMS_G_System_OPERATING_SYSTEM.BuildNumber = “15063” or SMS_G_System_OPERATING_SYSTEM.BuildNumber = “16299” or SMS_G_System_OPERATING_SYSTEM.BuildNumber = “17134”

  12. I have many versions of windows Retail, Business and Consumer how do I build the query for them.

  13. but this will include server 2016 machines also?

  14. Avatar photo nick giemsa says:

    If you hit the value button in the criteria menu, it will display a list of build numbers

  15. Avatar photo Frank Garufi Jr. says:

    Was hoping that maybe you could update this or point me to where I can create a Device Collection for Windows 10 2016 ( 1607 ) Enterprise LTSB?

  16. Avatar photo Schikitar says:

    Does that query need to be amended for the November Update, now that the build number has changed to 10586? Or perhaps it would be a good idea to split the collections?

    1. I guess yes, the query needs to be updated. Will update it soon. Thanks for notifying me about that.