Query Details

Device Showall Windows Versionsand Numberof Deviceswitheach Version

Query

// Show all Windows Versions and Number of Devices with each Version
IntuneDevices
| where OS contains "Windows"
| summarize arg_max(TimeGenerated, *) by DeviceName
| where todatetime(LastContact) > ago(30d) 
| extend WindowsVersion = case(
    OSVersion contains '19041', "20H1", 
    OSVersion contains '19042', "20H2",    
    OSVersion contains '19043', "21H1", 
    OSVersion contains '19044', "21H2",
    OSVersion contains '18363', "1909",
    OSVersion contains '22000', "Win11 21H2",
    OSVersion contains '22621', "Win11 Insider (22H2)",
    "Unknown")
| summarize ['Number of Devices']=count(DeviceName) by WindowsVersion
| distinct WindowsVersion, ['Number of Devices'] 
| sort by ['Number of Devices'] desc
//| where WindowsVersion != "Unknown" // Activate this line to show only Devices that have reported the Windows Version

Explanation

This query is designed to show all the different versions of Windows that are currently being used on devices, and how many devices are using each version. It does this by looking at data from the last 30 days. The query also categorizes the versions of Windows into more understandable terms, like "20H1" for version '19041', "20H2" for version '19042', and so on. The results are then sorted by the number of devices using each version, from most to least. There's also an option to exclude devices that haven't reported their Windows version.

Details

Ugur Koc profile picture

Ugur Koc

Released: July 1, 2022

Tables

IntuneDevices

Keywords

WindowsVersions,NumberofDevices,IntuneDevices,DeviceName,LastContact,OSVersion,Unknown

Operators

wheresummarizearg_maxtodatetimeagoextendcasecontainscountdistinctsort by

Actions