Common Group Policy WMI Queries

LIstThis post contains common WMI filtering queries for Group Policy. If you require different queries then download WMI Explorer to identify the Classes and Properties you require.


Example WMI Filtering Queries for Group Policy

Description of QuerySyntax to be inserted into the WMI filter in the GPMC
OS is Windows 10 EnterpriseSelect * from Win32_OperatingSystem where Caption = "Microsoft Windows 10 Enterprise"
OS is Windows XPselect * from Win32_OperatingSystem WHERE Version like "5.1%" AND ProductType="1"
OS is Windows Server 2003select * from Win32_OperatingSystem WHERE Version like "5.2%" AND NOT ProductType ="1"
OS is Windows Server 2003 R2select * from Win32_OperatingSystem WHERE Version like "5.2.3%" AND NOT ProductType ="1"
OS is Windows Vistaselect * from Win32_OperatingSystem WHERE Version like "6.0%" AND ProductType="1"
OS is Windows Server 2008select * from Win32_OperatingSystem WHERE Version like "6.0%" AND NOT ProductType="1"
OS is Windows 7select * from Win32_OperatingSystem WHERE Version like "6.1%" AND ProductType="1"
OS is Windows Server 2008 R2select * from Win32_OperatingSystem WHERE Version like "6.1%" AND NOT ProductType="1"
OS is Windows 8select * from Win32_OperatingSystem WHERE Version like "6.2%" AND ProductType="1"
OS is Windows Server2012select * from Win32_OperatingSystem WHERE Version like "6.2%" AND NOT ProductType="1"
OS is Windows 8.1select * from Win32_OperatingSystem WHERE Version like "6.3%" AND ProductType="1"
OS is Windows Server 2012 R2select * from Win32_OperatingSystem WHERE Version like "6.3%" AND NOT ProductType="1"
OS is Windows 10select * from Win32_OperatingSystem WHERE Version like "10.0%" AND ProductType="1"
OS is Windows 10 (32-bit)select * from Win32_OperatingSystem WHERE Version like "10.%" AND ProductType="1" AND NOT OSArchitecture = "64-bit"
OS is Windows 10 (64-bit)select * from Win32_OperatingSystem WHERE Version like "10.%" AND ProductType="1" AND OSArchitecture = "64-Bit"
OS is Windows 2016select * from Win32_OperatingSystem WHERE Version like "10.%" AND (ProductType = "2") OR (ProductType = "3")
Is a Windows Server (any OS version)select * from Win32_OperatingSystem where (ProductType = "2") OR (ProductType = "3")
Is a Windows Server (any OS version, 32-bit only)select * from Win32_OperatingSystem where (ProductType = "2") OR (ProductType = "3") AND NOT OSArchitecture = "64-bit"
Is a Windows Server (any OS version, 64-bit only)select * from Win32_OperatingSystem where (ProductType = "2") OR (ProductType = "3") AND OSArchitecture = "64-bit"
Is a Windows Server Domain Controller (any OS)select * from Win32_OperatingSystem where (ProductType = "2")
Is a Windows Server Domain Controller (any 32-bit OS)select * from Win32_OperatingSystem where (ProductType = "2") AND NOT OSArchitecture = "64-bit"
Is a Windows Server Domain Controller (any 64-bit OS)select * from Win32_OperatingSystem where (ProductType = "2") AND OSArchitecture = "64-bit"
Computers in UTC -08:00 Pacific Std Timezoneselect * from Win32_Timezone where bias =-480
Computers in UTC -06:00 Central Std Timezoneselect * from Win32_Timezone where bias =-360
Computers in UTC -05:00 Eastern Std Timezoneselect * from Win32_Timezone where bias =-300
Computers in UTC + 00:00 (London)select * from Win32_Timezone where bias =0
Computers in UTC + 01:00 (Paris etc)select * from Win32_Timezone where bias =60
Computers in UTC + 09:00 (Tokyo)select * from Win32_Timezone where bias =540
Computers in UTC +10:00 (Sydney)select * from Win32_Timezone where bias =600
Computers in UTC +12:00 (Auckland)select * from Win32_Timezone where bias =720
Computers that have modemsselect * from Win32_POTSModem Where Name = " MyModem"
Computers that support Multicastingselect * from Win32_NetworkProtocol where SupportsMulticasting = true
Free Disk Space > 200 MB and File System Typeselect * from Win32_LogicalDisk where (Name = "C:") AND DriveType = 3 AND FreeSpace > 200000000 AND FileSystem = " NTFS"
Only Dell Latitude Laptopsselect * from Win32_ComputerSystem where manufacturer like "%Dell%" AND Model like "%Latitude%"
Has both software packages "MSI-1" and "MSI-1"select * from Win32_Product WHERE Name = "MSI-1" AND Name = "MSI-2"
Computers have hotfix q123456 installedselect * from Win32_QuickFixEngineering where HotFixID = 'q123456'

 

Leave a Reply

Your email address will not be published. Required fields are marked *