WMI filters are useful to further filter Group Policy Objects (GPOs), beyond what is possible/convenient with groups.
Distinguish between x86 and x64 computers:
x86
Select AddressWidth from Win32_Processor where (AddressWidth=”32″)
x64
Select AddressWidth from Win32_Processor where (AddressWidth=”64″)
Determine Windows version:
Use this filter to determine the Windows version and role:
select * from Win32_OperatingSystem where Version like “6.%” and ProductType = “1”
- The Version property returns values that begin with the following characters (the % symbol is a wildcard character that represents other characters that can follow, but do not help distinguish the version number):
Windows Server 2008 R2 or Windows 7 6.1% Windows Server 2008 or Windows Vista 6.0% Windows Server 2003 5.2% Windows XP 5.1% Windows 2000 5.0% - The ProductType property returns the following values:
Client versions of Windows 1 Server versions of Windows that are operating as a domain controller 2 Server versions of Windows that are not operating as a domain controller (typically referred to as member servers) 3
Determine computer type (laptop, desktop etc.)
NOTE: The PCSystemType property in only available on Windows Vista and later OSs.
SELECT * FROM Win32_ComputerSystem WHERE PCSystemType = 1
These are the possible values for PCSystemType:
Value | Meaning |
0 | Unspecified |
1 | Desktop |
2 | Mobile |
3 | Workstation |
4 | Enterprise Server |
5 | Small Office and Home Office (SOHO) Server |
6 | Appliance PC |
7 | Performance Server |
8 | Maximum |
(I’d really like a computer with type 8, please!)