iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
To count managed Windows 10 devices by release in Configuration Manager, join v_R_System to v_GS_OPERATING_SYSTEM on ResourceID, map the operating-system build to a release label, and group the results. The SQL below is a starting pattern, not a guaranteed production query: counts depend on the hardware inventory available at your site and on which devices and editions you include.
Build a SQL count by Windows release
Configuration Manager’s v_GS_OPERATING_SYSTEM hardware inventory view lists operating-system information found on clients. Microsoft’s hardware inventory reference documents the view and the ResourceID relationship: Hardware inventory views – Configuration Manager.
This query groups records by operating-system name and raw build, then counts distinct resource IDs. It labels common Windows 10 builds and puts unrecognized builds in a review category so they remain visible.
SELECT
s.Operating_System_Name_and0 AS [Operating System],
os.BuildNumber0 AS [Build Number],
CASE
WHEN os.BuildNumber0 = '19045' THEN 'Windows 10 22H2'
WHEN os.BuildNumber0 = '19044' THEN 'Windows 10 21H2'
WHEN os.BuildNumber0 = '19043' THEN 'Windows 10 21H1'
WHEN os.BuildNumber0 = '19042' THEN 'Windows 10 20H2'
WHEN os.BuildNumber0 = '19041' THEN 'Windows 10 2004'
ELSE 'Other / review mapping'
END AS [Windows Version],
COUNT(DISTINCT s.ResourceID) AS [Total Devices]
FROM v_R_System AS s
INNER JOIN v_GS_OPERATING_SYSTEM AS os
ON s.ResourceID = os.ResourceID
WHERE s.Operating_System_Name_and0 LIKE '%Microsoft Windows NT Workstation 10.0%'
GROUP BY
s.Operating_System_Name_and0,
os.BuildNumber0
ORDER BY os.BuildNumber0 DESC;
Adapt and validate the result
- Check the scope filter. The sample matches Windows workstation records whose operating-system name contains the stated string. Confirm the actual values in your site and decide whether other Windows editions or device types belong in the count.
- Choose the device-count policy. The query counts distinct ResourceIDs, but that does not by itself define which devices are current or in scope. Decide how your organization treats stale clients and validate the inventory records before using the totals operationally.
- Keep the build column. The friendly release label is derived from the build mapping. Keeping the raw build makes it possible to audit the label and identify builds the CASE expression does not yet cover.
- Review unknown builds. The ELSE branch groups unmapped builds under “Other / review mapping.” Add a mapping only after checking the build against an authoritative release reference; do not infer a release from an incomplete label.
The Microsoft Q&A example uses the same general join, filter, build mapping, and grouping approach, and maps build 19045 to Windows 10 22H2. The distinct count and explicit unknown-build category above clarify the intended device measure; they are adaptations, not a claim that Microsoft prescribes this exact query. See the Microsoft Q&A example and validate the view columns and values in your own site.
#1 Best Overall
Choose between SQL counts and the servicing dashboards
A custom SQL query is useful when the specific output you need is a count grouped by release or build. Configuration Manager also provides Windows servicing and product lifecycle dashboards for related questions. The servicing dashboard presents servicing and build information; the lifecycle dashboard focuses on product supportability and end dates.
- Use a custom count query when you need a defined device population and totals grouped by the release labels or builds you choose.
- Check the built-in dashboards when the question is about servicing status or product supportability rather than a custom release-count breakdown.
- Confirm your installed Configuration Manager version and prerequisites. Dashboard availability and freshness depend on the deployed release, the online service connection, and synchronized servicing or update data. Microsoft documents the dashboard behavior and requirements in Manage Windows as a service.
For a console query that lists Windows 10 computer names and operating-system versions, Microsoft documents a separate WQL example in Create queries – Configuration Manager. That is useful for a per-computer listing, but it is not the SQL aggregation shown here.
Rank #2
- 15.6" diagonal, HD (1366 x 768), micro-edge, BrightView, 220 nits, 45% NTSC.
Interpret Windows 10 22H2 counts with lifecycle in mind
Microsoft identifies build 19045 as Windows 10 version 22H2. A release label does not establish that every device with that label is supported: Windows 10 22H2 general availability editions reached end of updates on 2025-10-14, while LTSC and LTSB editions follow separate lifecycles. Check the edition and applicable lifecycle before drawing a supportability conclusion. Microsoft’s Windows 10 release information lists release and build details; its current page includes revision-specific builds, which can change as updates are published.
Microsoft describes Windows 10 22H2 as a scoped feature release available through Windows Server Update Services, including Configuration Manager. That describes a deployment channel, not a guarantee that a particular device’s inventory or servicing status is current; see What’s new in Windows 10, version 22H2.
Rank #3
- 10th Generation Intel Core i5-1035G1 processor
- 12GB system memory for full-power multitasking
- 256GB Solid State Drive
- 15.6" Micro-edge touchscreen display
What the totals do—and do not—tell you
The query reports the operating-system inventory recorded for matching Configuration Manager resources. It does not independently verify that every endpoint has checked in recently, establish that an installation is fully updated, or determine support status by edition. Define the in-scope population, check inventory freshness, and keep release/build mapping separate from lifecycle interpretation when turning the result into a dashboard.
Quick Recap
Best Value
Rank #4
- Latitude 7480 Laptop 14"
- Intel Core i7 6th Gen i7-6600U -Core Processor 2.6GHz (3.4GHz With Turbo Boost)
- 256 GB SSD Hard Drive & 16GB Memory
- 1920x1080 FHD resolution Non-Touch with Webcam and an integrated graphics chip
- Wireless Wifi & Bluetooth
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

