Computer >> Computer tutorials >  >> System >> windows

Win32_OperatingSystem BuildNumber don’t work on Windows 10

In today’s post, we will identify the cause and then provide the resolution to the issue of Windows Management Instrumentation (WMI) Group Policy filters, that compare Win32_OperatingSystem BuildNumber, don’t work as expected on Windows 10.

Windows Management Instrumentation (WMI) is Microsoft’s implementation of the Web-Based Enterprise Management (WBEM) and Common Information Model (CIM) standards from the Distributed Management Task Force (DMTF) which is a set of specifications from Microsoft for consolidating the management of devices and applications in a network from Windows computing systems.

Win32_OperatingSystem BuildNumber don’t work on Windows 10

WMI allows scripting languages (such as VBScript or Windows PowerShell) to manage Microsoft Windows personal computers and servers, both locally and remotely. WMI comes preinstalled in Windows 2000 and in newer Microsoft OSes.

WMI also supports such actions as the configuration of security settings, setting and changing system properties, setting and changing permissions for authorized users and user groups, assigning and changing drive labels, scheduling processes to run at specific times, backing up the object repository, and enabling or disabling error logging.

WMI Group Policy filter Win32_OperatingSystem BuildNumber not working

You experience this issue based on 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. And you create the following Windows Management Instrumentation (WMI) filter:

“Select BuildNumber from Win32_OperatingSystem WHERE BuildNumber >= 9200 “

Based on known build numbers of Windows versions as shown in the table below:

Build number Windows version
9200 Windows 8
9600 Windows 8.1
10240 Windows 10
10586 Windows 10, version 1511
14393 Windows 10, version 1607
15063 Windows 10, version 1703
16299 Windows 10, version 1709
17134 Windows 10, version 1803
17763 Windows 10, version 1809
18362 Windows 10, version 1903

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.

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

To resolve this issue, use a filter that resembles the following example:

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]%"

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

Hope this helps!

Win32_OperatingSystem BuildNumber don’t work on Windows 10