WMI Filter examples

1. Terminal server detection. Class Win32_TerminalServiceSetting is missed at the client OS. So, WMI filter return FALSE if there is no such class (for regular desktop or servers) and TRUE if class exists and return proper value.

root\CIMV2. SELECT * FROM Win32_TerminalServiceSetting where TerminalServerMode=1

2. Notebook detection (http://www.heidelbergit.dk/2008/02/wmi-filter-contest-are-you-knight-in.html)

by memory type (SODIMM). Not 100% guarantee. There are cases when such class return at a notebook FormFactor = 8, (DIMM instead of SODIMM).

root\CIMV2. Select * from Win32_PhysicalMemory where FormFactor = 12

by battery. Not 100% guarantee. E.g. when desktop has USB connected UPS it returns, that battery available.

root\CIMV2. SELECT EstimatedChargeRemaining FROM Win32_Battery


  1. http://technet.microsoft.com/en-us/library/cc779036(v=ws.10).aspx
  2. http://www.heidelbergit.dk/2008/02/wmi-filter-contest-are-you-knight-in.html
  3. http://blogs.technet.com/b/heyscriptingguy/archive/2006/09/29/how-can-i-determine-whether-terminal-services-is-enabled-on-a-windows-server-2003-computer.aspx
  4. Using WMI to detect if running on a Windows 2003 or 2008 Terminal Server. http://www.jhouseconsulting.com/2008/12/03/using-wmi-to-detect-if-running-on-a-windows-2003-or-2008-terminal-server-226
  5. WMI Tasks for Scripts and Applications. http://msdn.microsoft.com/en-us/library/windows/desktop/aa394585(v=vs.85).aspx
  6. Seacrhing computer’s OU or DN in WMI filter. http://social.technet.microsoft.com/Forums/en-NZ/winserverGP/thread/efa8d1f8-1ef9-47b6-8a1b-ea633a5c213a
  7. Well-Known Detectoid IDs. http://msdn.microsoft.com/en-us/library/windows/desktop/bb902472(v=vs.85).aspx
  8. Fun with WMI Filters in Group Policy. http://blogs.technet.com/b/askds/archive/2008/09/11/fun-with-wmi-filters-in-group-policy.aspx?PageIndex=2#comments
  9. Implementing WMI filters http://www.zeda.nl/EN/Blog/018_Implementing_WMI_Filters/
  10. WMI filtering using GPMC. http://technet.microsoft.com/en-us/library/cc779036(v=ws.10).aspx
  11. After you apply a WMI filter, the GPO does not take effect on a client computer that is running Windows 7 or Windows Server 2008 R2. http://support.microsoft.com/kb/979383
  12. Create the WMI Filters. http://technet.microsoft.com/en-us/library/cc904288(WS.10).aspx
  13. WMI Filter Validation Utility. http://www.gpoguy.com/FreeTools/FreeToolsLibrary/tabid/67/agentType/View/PropertyID/93/Default.aspx
Spread the love
This entry was posted in IT Recipies, IT tools. Bookmark the permalink.

Leave a Reply

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