Query Details
// Show EOL Dates and the number of devices effected for Win 11 21H2, Win 10 21H2, 21H1 and also 20H2.
let Windows11_21H2 =
IntuneDevices
| where OS has "Windows"
| extend Build = split(OSVersion, ".")[2]
| where Build contains "22000"
| summarize count(DeviceName) by tostring(Build)
| extend ['Win11_21H2 Home, Pro - End of servicing'] = "2023-10-10"
| extend ['Win11_21H2 Enterprise - End of servicing'] = "2024-10-08"
| extend CustomName="Number of Devices";
let 21H2 =
IntuneDevices
| where OS has "Windows"
| extend Build = split(OSVersion, ".")[2]
| where Build contains "19044"
| summarize count(DeviceName) by tostring(Build)
| extend ['21H2 Home, Pro - End of servicing'] = "2023-06-13"
| extend ['21H2 Enterprise - End of servicing'] = "2024-06-11"
| extend CustomName="Number of Devices";
let 21H1 =
IntuneDevices
| where OS has "Windows"
| extend Build = split(OSVersion, ".")[2]
| where Build contains "19043"
| summarize count(DeviceName) by tostring(Build)
| extend ['21H1 Home, Pro - End of servicing'] = "2022-12-13"
| extend ['21H1 Enterprise - End of servicing'] = "2022-12-13"
| extend CustomName="Number of Devices";
let 20H2 =
IntuneDevices
| where OS has "Windows"
| extend Build = split(OSVersion, ".")[2]
| where Build contains "19042"
| summarize count(DeviceName) by tostring(Build)
| extend ['20H2 Home, Pro - End of servicing'] = "End of servicing"
| extend ['20H2 Enterprise - End of servicing'] = "2023-05-09"
| extend CustomName="Number of Devices";
21H2
| join kind=inner 21H1 on CustomName
| join kind=inner 20H2 on CustomName
| join kind=inner Windows11_21H2 on CustomName
| project
['Number of Devices with 21H2'] = count_DeviceName, ['21H2 Home, Pro - End of servicing'], ['21H2 Enterprise - End of servicing'],
['Number of Devices with 21H1'] = count_DeviceName1, ['21H1 Home, Pro - End of servicing'], ['21H1 Enterprise - End of servicing'],
['Number of Devices with 20H2'] = count_DeviceName2, ['20H2 Home, Pro - End of servicing'], ['20H2 Enterprise - End of servicing'],
['Number of Devices with Win11_21H2'] = count_DeviceName3, ['Win11_21H2 Home, Pro - End of servicing'], ['Win11_21H2 Enterprise - End of servicing']
This query is designed to provide a report on the number of devices running specific versions of Windows, namely Windows 11 21H2, Windows 10 21H2, 21H1 and 20H2. For each version, it identifies the number of devices running that version and the end of service dates for both Home/Pro and Enterprise editions.
The query first defines four separate data sets, each corresponding to a specific Windows version. It filters the devices that are running Windows, extracts the build number from the OS version, and counts the number of devices for each build. It then adds the end of service dates for each version and edition.
Finally, it combines these four data sets into a single table, showing the number of devices and end of service dates for each Windows version and edition.

Ugur Koc
Released: August 12, 2022
Tables
Keywords
Operators