WMIC Filters

From wiki.adammorgan.org
Jump to: navigation, search

General Info

For targeting Group Policies

Links

Technet: Create WMI Filters for Group Policy [1] Other links: [2][3]

Parameters

ProductType

  • ProductType 1 = Desktop OS
  • ProductType 2 = Server OS – Domain Controller
  • ProductType 3 = Server OS – Not a Domain Controller

Version

  • 5.1 – Windows XP
  • 5.2 – Windows Server 2003
  • 5.2.3 – Windows Server 2003 R2
  • 6.0 – Windows Vista & Windows Server 2008
  • 6.1 – Windows 7 & Windows Server 2008 R2
  • 6.2 – Windows 8 & Windows Server 2012
  • 6.3 – Windows 8.1 & Windows Server 2012 R2

Filters

Operating System 32-bit

Select * from Win32_Processor where AddressWidth = '32' 

Operating System 64-bit

Select * from Win32_Processor where AddressWidth = '64'

Workstation

Select * from WIN32_OperatingSystem where ProductType=1 

Domain Controller

Select * from WIN32_OperatingSystem where ProductType=2 

Server

Select * from WIN32_OperatingSystem where ProductType=3 

Workstation 32-bit

Select * from WIN32_OperatingSystem where ProductType=1 
Select * from Win32_Processor where AddressWidth = '32' 

Workstation 64-bit

Select * from WIN32_OperatingSystem where ProductType=1 
Select * from Win32_Processor where AddressWidth = '64'

Windows XP

Select * from WIN32_OperatingSystem where Version like '5.1.%' and ProductType=1 

Windows Vista

Select * from WIN32_OperatingSystem where Version like '6.0.%' and ProductType=1 

Windows 7

Select * from WIN32_OperatingSystem where Version like '6.1.%' and ProductType=1 

Windows 2003

Select * from WIN32_OperatingSystem where Version like '5.2.%' and ProductType>1 

Windows 2008

Select * from WIN32_OperatingSystem where Version like '6.0.%' and ProductType>1 

Windows 2008 R2

Select * from WIN32_OperatingSystem where Version like '6.1.%' and ProductType>1 

WIN32_OperatingSystem of course includes more information that can be useful for WMI queries, such as a descriptive name of the installed OS ("Name") as well as the service pack installed ("ServicePackMajorVersion").

Manufacturer (e.g. DELL)

Select * from WIN32_ComputerSystem where Manufacturer = 'DELL' 

Installed Memory (e.g. more than 1Gb)

Select * from WIN32_ComputerSystem where TotalPhysicalMemory >= 1073741824