WMI Group Policy filters that compare Win32_OperatingSystem BuildNumber don't work as expected on Windows 10


Consider the following scenario:
  • You want Group Policy to apply to Windows 8.1 and later versions of Windows. 
  • You want to use Win32_OperatingSystem BuildNumber to do this.
  • You create the following Windows Management Instrumentation (WMI) filter, based on known build numbers of Windows versions: 

    “Select BuildNumber from Win32_OperatingSystem WHERE BuildNumber >= 9200 “

    Build numberWindows version
    9200 Windows 8
    9600Windows 8.1
    10240  Windows 10
    10586 Windows 10 version 1511

In this scenario, although you would expect the WMI filter to cause the Group Policy setting to apply to build number 9200 and later builds, Windows 10 builds are excluded.


This issue occurs because the data type for BuildNumber is String and not Integer. Therefore, 10*** < 9600.


To fix this issue, use a filter that resembles the following example.

Note There are several ways to have the string compare to return the result that you want. You can use any method that you prefer. The example is fully functional.

Select BuildNumber from Win32_OperatingSystem WHERE BuildNumber >= 10000 AND BuildNumber LIKE "%[123456789][0123456789][0123456789][0123456789][0123456789]%" OR BuildNumber >= 9200 AND BuildNumber LIKE "%[123456789][0123456789][0123456789][0123456789]%"

Makale No: 3119213 - Son İnceleme: 1 Ara 2015 - Düzeltme: 1

Geri bildirim