WQL collection queries

Find Windows 10 computers by build number

A WQL collection query that returns Windows 10 computers on one build number, such as 19045 for version 22H2.

LanguageWQL
What it does to the systemReads only. It changes nothing.

This query builds a device collection of Windows 10 computers on one build. Build 19045 is Windows 10 version 22H2.

Use it to find computers that still run an old build, or to target one build with a feature update.

WQL
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 like "Microsoft Windows 10%"
  and SMS_G_System_OPERATING_SYSTEM.BuildNumber = "19045"

How to use it

  1. In the console, open Assets and Compliance, then Device Collections.
  2. Open the collection properties. On Membership Rules, select Add Rule, then Query Rule.
  3. Select Edit Query Statement, then Show Query Language. Paste the query.
  4. Change "19045" to the build you want. Keep the quotes.
  5. To find every build except one, change = to !=.

Good to know

  • Common Windows 10 builds: 19045 (22H2), 19044 (21H2), 19043 (21H1), 19042 (20H2), 17763 (1809).
  • The build number comes from hardware inventory. It updates after the next inventory cycle.
Windows 10 build number SMS_G_System_OPERATING_SYSTEM feature update
✉

Get new articles in your inbox

SCCM guides, AI tools, automation tips — sent when published. No spam.