WMI Filter Cheat Sheet
Published by Danny Moran
Table of Contents
Introduction
This is my collection of WMI filters. I have collected these over the years to assist with narrowing group policy object scopes. If you are unsure on how to apply WMI filters to Group Policy Objects, I have a guide, how to use WMI filters for group policy, which is a step-by-step guide for creating WMI filters and then applying the filters to a Group Policy Object.
Please test these filters before applying them to your production environments.
WMI filters for Windows Desktop Operating Systems
WMI filter for Windows 11
WMI filter for Windows 11 (All Versions)
select * from Win32_OperatingSystem where Version like "10.0.2%" and ProductType="1"
WMI filter for Windows 11 (23H2)
select * from Win32_OperatingSystem where Version like "10.0.22631%" and ProductType="1"
WMI filter for Windows 11 (22H2)
select * from Win32_OperatingSystem where Version like "10.0.22621%" and ProductType="1"
WMI filter for Windows 11 (21H2)
select * from Win32_OperatingSystem where Version like "10.0.22000%" and ProductType="1"
WMI filter for Windows 10
WMI filter for Windows 10 (All Versions)
select * from Win32_OperatingSystem where Version like "10.0.1%" and ProductType="1"
WMI filter for Windows 10 (22H2)
select * from Win32_OperatingSystem where Version like "10.0.19045%" and ProductType="1"
WMI filter for Windows 10 (21H2)
select * from Win32_OperatingSystem where Version like "10.0.19044%" and ProductType="1"
WMI filter for Windows 10 (21H1)
select * from Win32_OperatingSystem where Version like "10.0.19043%" and ProductType="1"
WMI filter for Windows 10 (20H2)
select * from Win32_OperatingSystem where Version like "10.0.19042%" and ProductType="1"
WMI filter for Windows 10 (2004)
select * from Win32_OperatingSystem where Version like "10.0.19041%" and ProductType="1"
WMI filter for Windows 10 (1909)
select * from Win32_OperatingSystem where Version like "10.0.18363%" and ProductType="1"
WMI filter for Windows 10 (1903)
select * from Win32_OperatingSystem where Version like "10.0.18362%" and ProductType="1"
WMI filter for Windows 10 (1809)
select * from Win32_OperatingSystem where Version like "10.0.17763%" and ProductType="1"
WMI filter for Windows 10 (1803)
select * from Win32_OperatingSystem where Version like "10.0.17134%" and ProductType="1"
WMI filter for Windows 10 (1709)
select * from Win32_OperatingSystem where Version like "10.0.16299%" and ProductType="1"
WMI filter for Windows 10 (1703)
select * from Win32_OperatingSystem where Version like "10.0.15063%" and ProductType="1"
WMI filter for Windows 10 (1607)
select * from Win32_OperatingSystem where Version like "10.0.14393%" and ProductType="1"
WMI filter for Windows 10 (1511)
select * from Win32_OperatingSystem where Version like "10.0.10586%" and ProductType="1"
WMI filter for Windows 10 (1507)
select * from Win32_OperatingSystem where Version like "10.0.10240%" and ProductType="1"
WMI filter for Windows 8 and 8.1
WMI filter for Windows 8 and 8.1
select * from Win32_OperatingSystem where (Version like "6.3%" and ProductType="1") or (Version like "6.2%" and ProductType="1")
WMI filter for Windows 8.1
WMI filter for Windows 8.1
select * from Win32_OperatingSystem where Version like "6.3%" and ProductType="1"
WMI filter for Windows 8
WMI filter for Windows 8
select * from Win32_OperatingSystem where Version like "6.2%" and ProductType="1"
WMI filter for Windows 7
WMI filter for Windows 7
select * from Win32_OperatingSystem where Version like "6.1%" and ProductType="1"
WMI filter for Windows Vista
WMI filter for Windows Vista
select * from Win32_OperatingSystem where Version like "6.0%" and ProductType="1"
WMI filter for Windows XP
WMI filter for Windows XP
select * from Win32_OperatingSystem where (Version like "5.1%" or Version like "5.2%") and ProductType="1"
WMI filter for Windows 2000
WMI filter for Windows 2000
select * from Win32_OperatingSystem where Version like "5.0%" and ProductType="1"
WMI filters for Standard Windows Server Release Channel (LTSC) Operating Systems
WMI filter for Windows Server 2022
WMI filter for Windows Server 2022
select * from Win32_OperatingSystem where Version like "10.0.20348%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 2019
WMI filter for Windows Server 2019
select * from Win32_OperatingSystem where Version like "10.0.17763%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 2016
WMI filter for Windows Server 2016
select * from Win32_OperatingSystem where Version like "10.0.14393%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 2012 R2
WMI filter for Windows Server 2012 R2
select * from Win32_OperatingSystem where Version like "6.3%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 2012
WMI filter for Windows Server 2012
select * from Win32_OperatingSystem where Version like "6.2%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 2008 R2
WMI filter for Windows Server 2008 R2
select * from Win32_OperatingSystem where Version like "6.1%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 2008
WMI filter for Windows Server 2008
select * from Win32_OperatingSystem where Version like "6.0%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 2003 and Windows Server 2003 R2
WMI filter for Windows Server 2003 and Windows Server 2003 R2
select * from Win32_OperatingSystem where Version like "5.2%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 2000
WMI filter for Windows Server 2000
select * from Win32_OperatingSystem where Version like "5.0%" and (ProductType="2" or ProductType="3")
WMI filters for Annual Windows Server Release Channel (AC) Operating Systems
WMI filter for Windows Server 23H2
WMI filter for Windows Server 23H2
select * from Win32_OperatingSystem where Version like "10.0.25398%" and (ProductType="2" or ProductType="3")
WMI filters for Semi-annual Windows Server Release Channel (SAC) Operating Systems
WMI filter for Windows Server 20H2
WMI filter for Windows Server 20H2
select * from Win32_OperatingSystem where Version like "10.0.19042%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 2004
WMI filter for Windows Server 2004
select * from Win32_OperatingSystem where Version like "10.0.19041%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 1909
WMI filter for Windows Server 1909
select * from Win32_OperatingSystem where Version like "10.0.18363%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 1903
WMI filter for Windows Server 1903
select * from Win32_OperatingSystem where Version like "10.0.18362%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 1809
WMI filter for Windows Server 1809
select * from Win32_OperatingSystem where Version like "10.0.17134%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 1803
WMI filter for Windows Server 1803
select * from Win32_OperatingSystem where Version like "10.0.16299%" and (ProductType="2" or ProductType="3")
WMI filter for Windows Server 1709
WMI filter for Windows Server 1709
select * from Win32_OperatingSystem where Version like "10.0.14393%" and (ProductType="2" or ProductType="3")
Additional WMI filters
WMI filter for Operating System Types
WMI filter for Desktop Operating Systems
The below WMI filter is for all windows workstation operating systems.
select * from Win32_OperatingSystem where ProductType="1"
WMI filter for Domain Controllers
The below WMI filter is for all windows server operating systems and are domain controllers.
select * from Win32_OperatingSystem where ProductType="2"
WMI filter for Member Servers
The below WMI filter is for all windows server operating systems and are not domain controllers.
select * from Win32_OperatingSystem where ProductType="3"
WMI filter for Domain Controllers and Member Servers
select * from Win32_OperatingSystem where ProductType="2" or ProductType="3"
WMI filter for Computer System Types
WMI filter for Standalone Workstation
select * from Win32_ComputerSystem where DomainRole="0"
WMI filter for Member Workstation
select * from Win32_ComputerSystem where DomainRole="1"
WMI filter for Standalone Server
select * from Win32_ComputerSystem where DomainRole="2"
WMI filter for Member Server
select * from Win32_ComputerSystem where DomainRole="3"
WMI filter for Backup Domain Controller
select * from Win32_ComputerSystem where DomainRole="4"
WMI filter for Primary Domain Controller (PDC)
select * from Win32_ComputerSystem where DomainRole="5"
This is the domain controller that holds the PDC FSMO role
WMI filter for 64-bit and 32-bit Operating Systems
WMI filter for 64-bit operating systems
select * from Win32_Processor where AddressWidth = "64"
WMI filter for 32-bit operating systems
select * from Win32_Processor where AddressWidth = "32"
WMI filter for Hostname
WMI filter for a device with a spesific hostname.
select * from Win32_ComputerSystem where Name like "computer-name"
WMI filter for devices with the same starting hostname format. (example hostnames: PC01, PC02, PC03, PC04)
select * from Win32_ComputerSystem where Name like "PC%"
WMI filter for System Manufacturer
select * from Win32_ComputerSystem where Manufacturer like "%Dell%"
To find the system manufacturer, run: wmic computersystem get manufacturer
WMI filter for System Model
select * from Win32_ComputerSystem where Name like "%XPS%"
To find the system model, run: wmic computersystem get model
WMI filter for Desktops
select * from Win32_ComputerSystem where PCSystemType="1" or PCSystemType="3"
WMI filter for Laptops
select * from Win32_ComputerSystem where PCSystemType="2"
WMI filter for Day of the Week (Mon/Tue/Wed/Thu/Fri/Sat/Sun)
WMI filter for Monday
select DayOfWeek from Win32_LocalTime where DayOfWeek="1"
WMI filter for Tuesday
select DayOfWeek from Win32_LocalTime where DayOfWeek="2"
WMI filter for Wednesday
select DayOfWeek from Win32_LocalTime where DayOfWeek="3"
WMI filter for Thursday
select DayOfWeek from Win32_LocalTime where DayOfWeek="4"
WMI filter for Friday
select DayOfWeek from Win32_LocalTime where DayOfWeek="5"
WMI filter for Saturday
select DayOfWeek from Win32_LocalTime where DayOfWeek="6"
WMI filter for Sunday
select DayOfWeek from Win32_LocalTime where DayOfWeek="7"
WMI filter for multiple days (Example uses Monday, Tuesday, and Friday)
select DayOfWeek from Win32_LocalTime where DayOfWeek="1" or DayOfWeek="2" or DayOfWeek="5"
WMI filter for Hard Drive Type (SSD/HDD)
WMI filter for SSD based systems
select * from MSFT_PhysicalDisk where MediaType="4"
WMI filter for HDD based systems
select * from MSFT_PhysicalDisk where MediaType="3"