1

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?

1

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]%"
  • Hi, Yagmoth. That's similar to my current workaround which is: select * from Win32_OperatingSystem WHERE (Version like "10.0.15063%") OR (Version like "10.0.16299%") AND ProductType="1" The problem is, every six months, there's going to be a new Windows 10 version number to add to the string, making it more and more unwieldy. is there any WMI wizardry you can use to detect "Creators and above"? – Dave Oct 25 '17 at 14:20
  • 1
    @Dave A wmi filter for not like old version could be the perfect workaround then. aka Where Not (version like "10.0.96%") and (version like "10.0.10%") and ... That and a wmi filter to detect if its a windows 10 in general. – yagmoth555 Oct 25 '17 at 14:40
  • 1
    Didn't think of using Not. I'll have a go this week, and report back. – Dave Oct 30 '17 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.