In this post, I will show you how to find Windows 11 versions using SCCM, SQL query, and CMPivot. Using any of these methods, you can quickly identify the different versions of Windows 11 running in your organization.
An organization that is managing Windows devices using Configuration Manager can find out most of the details about the devices. The Windows version details for devices are mostly contained in the SCCM database that can be pulled up using a SQL query or CMPivot tool.
Before trying out any of the methods described in this post, make sure that your Windows devices are installed with the ConfigMgr agent and show as active in the console. If you have recently performed a Configuration Manager CB upgrade, make sure the client agents are on the latest version.

Methods to determine the versions of Windows 11 using SCCM
I am going to demonstrate two methods to find Windows 11 versions using SCCM.
- Use a SQL query to get the version information of Windows 11.
- Run a CMPivot query and determine the Windows 11 versions.
Among the above methods, the CMPivot approach is easier to instantly identify devices running Windows 11 directly from the SCCM console. If CMPivot doesn’t produce any results, an alternative method to try is an SQL query.
Using Build Numbers to Identify the Version of Windows 11
The methods discussed in this guide will use the build number of Windows 11 to determine the exact version. With every yearly Windows 11 release, the build number is changed. I have published a guide on Windows 11 release history, which can help you find the build number and version details.
Method 1: Find Windows 11 Versions using SCCM SQL Query
To find the Windows 11 versions using the SCCM SQL query:
- Launch the SQL Server Management Studio (SSMS) and connect to the database engine.
- Expand Databases and right-click the SCCM database, and select New Query.
- In the query window, paste and execute the below SCCM SQL query to find the Windows 11 versions.
select v_R_System.Name0 as 'Hostname',
v_R_System.User_Name0 as 'System Username',
v_R_System.Operating_System_Name_and0 as 'Operating System',
v_GS_OPERATING_SYSTEM.BuildNumber0 as 'Windows OS Build Number',
case
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '26100' then 'Windows 11 24H2'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '22631' then 'Windows 11 23H2'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '22621' then 'Windows 11 22H2'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '22000' then 'Windows 11 21H2'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '19045' then 'Windows 10 22H2'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '19044' then 'Windows 10 21H2'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '19043' then 'Windows 10 21H1'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '19042' then 'Windows 10 20H2'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '19041' then 'Windows 10 2004'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '18363' then 'Windows 10 1909'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '18362' then 'Windows 10 1903'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '17763' then 'Windows 10 1809'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '17134' then 'Windows 10 1803'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '16299' then 'Windows 10 1709'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '15063' then 'Windows 10 1703'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '14393' then 'Windows 10 1607'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '10586' then 'Windows 10 1511'
when v_GS_OPERATING_SYSTEM.BuildNumber0 = '10240' then 'Windows 10 1507'
End as 'Windows OS Version'
from v_r_system
inner join v_gs_operating_system
on v_R_System.ResourceID=v_GS_OPERATING_SYSTEM.ResourceID
where v_R_System.Operating_System_Name_and0 like '%Microsoft Windows NT Workstation 10.0%'
order by v_R_System.Name0
Note: The above query has been updated to include version Windows 11 24H2, which is the new update released in October 2024. In addition to Windows 11 versions, the above query also lists all the Windows 10 versions up to version 22H2.

Method 2: Use SCCM CMPivot Query to Find Windows 11 Versions
In this method, we will use a CMPivot query to find the Windows 11 versions.
- Launch the ConfigMgr console and go to Assets and Compliance > Overview > Device Collections.
- Right-click the device collection and select Start CMPivot.
- Enter the following query to find the Windows 11 version.
OperatingSystem | where BuildNumber == '26100'
The above CMPivot lists all the devices running Windows 11 version 24H2.
CMPivot query to check Windows 11 versions
If your SCCM setup includes only Windows 11 devices, use the below CMPivot query to check all versions of Windows 11.
OperatingSystem | where ProductType == 1 | project Edition=case(
BuildNumber == '22000', 'Windows 11 21H2',
BuildNumber == '22621', 'Windows 11 22H2',
BuildNumber == '22621', 'Windows 11 23H2',
BuildNumber == '26100', 'Windows 11 24H2',
BuildNumber > '26100', 'Windows 11 Other',
BuildNumber)
| summarize count() by Edition | order by count_ asc

CMPivot query to check Windows 10 versions
To determine all the existing Windows 10 versions managed by SCCM, use the following CMPivot query.
OperatingSystem | where ProductType == 1 | project Edition=case(
BuildNumber == '10240', 'Windows 10 1507',
BuildNumber == '10586', 'Windows 10 1511',
BuildNumber == '14393', 'Windows 10 1607',
BuildNumber == '15063', 'Windows 10 1703',
BuildNumber == '16299', 'Windows 10 1709',
BuildNumber == '17134', 'Windows 10 1803',
BuildNumber == '17763', 'Windows 10 1809',
BuildNumber == '18362', 'Windows 10 1903',
BuildNumber == '18363', 'Windows 10 1909',
BuildNumber == '19041', 'Windows 10 2004',
BuildNumber == '19042', 'Windows 10 20H2',
BuildNumber == '19043', 'Windows 10 21H1',
BuildNumber == '19044', 'Windows 10 21H2',
BuildNumber == '19045', 'Windows 10 22H2',
BuildNumber > '19045', 'Windows 10 Other',
BuildNumber)
| summarize count() by Edition | order by count_ asc

CMPivot query to check all Windows versions
If you want to use a single query to determine the Windows versions that include Windows 7, Windows 8, Windows 10, and Windows 11 in one go, here is the CMPivot query:
OperatingSystem | where ProductType == 1 | project Edition=case(
BuildNumber == '2600', 'Windows XP',
BuildNumber like '760%', 'Windows 7',
BuildNumber == '9600', 'Windows 8',
BuildNumber == '10240', 'Windows 10 1507',
BuildNumber == '10586', 'Windows 10 1511',
BuildNumber == '14393', 'Windows 10 1607',
BuildNumber == '15063', 'Windows 10 1703',
BuildNumber == '16299', 'Windows 10 1709',
BuildNumber == '17134', 'Windows 10 1803',
BuildNumber == '17763', 'Windows 10 1809',
BuildNumber == '18362', 'Windows 10 1903',
BuildNumber == '18363', 'Windows 10 1909',
BuildNumber == '19041', 'Windows 10 2004',
BuildNumber == '19042', 'Windows 10 20H2',
BuildNumber == '19043', 'Windows 10 21H1',
BuildNumber == '19044', 'Windows 10 21H2',
BuildNumber == '19045', 'Windows 10 22H2',
BuildNumber == '22000', 'Windows 11 21H2',
BuildNumber == '22621', 'Windows 11 22H2',
BuildNumber == '22621', 'Windows 11 23H2',
BuildNumber == '26100', 'Windows 11 24H2',
BuildNumber > '26100', 'Windows 11 Other',
BuildNumber)
| summarize count() by Edition | order by count_ asc

You can also watch a YouTube tutorial that shows how to find Windows 11 versions using SQL Query and CMPivot Query using SCCM.
Still Need Help?
If you need further assistance on the above article or want to discuss other technical issues, check out some of these options.