Windows – WMI Filter to detect Windows 10 Creators Update or higher

group-policywindowswindows 10wmi

I have a group policy that needs to apply to Windows 10 Creators / version 1703 / Build 15063 and higher, (Specifically Cross Domain Drive mappings)

Until Fall Creators came out, detecting specifically for creators update worked with this code:

select * from Win32_OperatingSystem WHERE Version like "10.0.15063%" AND ProductType="1"

But going forward, I need this to apply to both Creators and Fall Creators, and presumably, Redstone 4+

Because BuildNumber is a String and not Integer, the obvious fix of changing "Version Like" to "version >" won't work, and would end up not applying to Windows 10, but applying to Windows Vista/7/8.

The Microsoft KnowledgeBase gives an example to detect anything Greater than Windows 10 RTM, but I specifically only want to detect Windows 10 Creators and higher. Can anyone assist with a suitable WMI filter?

Best Answer

Microsoft don't easily allow that, for the exact reason you found, it's a string, not a number. Please see WMI Group Policy filters that compare Win32_OperatingSystem BuildNumber don't work as expected on Windows 10

A workaround like they wrote is to compare all possible string;

Select BuildNumber from Win32_OperatingSystem WHERE  BuildNumber LIKE "%[15063][16299]%"
Related Topic