Group Policy WMI filters for Windows 7/8/8.1/10

Every now and then during Windows 10 deployments we need to use WMI filters for group policy objects, there are simply no better way of doing this, without a lot of work. WMI is simple to use and demands little maintenance.

There WMI filters may also come handy since there are group policy settings that only applies to one or two builds.

So here are some examples, ready to use for all operating system.

There are three queries for all operating system, 64-bit, 32-bit and both.

Note! Due to performance do NOT use Select * instead use Select Version as in the queries below, Why? See this article Using group policy WMI filters computers booting slow?

 

Windows 10 1703

select Version from Win32_OperatingSystem WHERE Version like “10.0.15063” AND ProductType=”1″ AND OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “10.0.15063” AND ProductType=”1″ AND NOT OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “10.0.15063” AND ProductType=”1″

Windows 10 1607

select Version from Win32_OperatingSystem WHERE Version like “10.0.14393” AND ProductType=”1″ AND OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “10.0.14393” AND ProductType=”1″ AND NOT OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “10.0.14393” AND ProductType=”1″

Windows 10 1511

select Version from Win32_OperatingSystem WHERE Version like “10.0.10586” AND ProductType=”1″ AND OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “10.0.10586” AND ProductType=”1″ AND NOT OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “10.0.10586” AND ProductType=”1″

Windows 10 1507

select Version from Win32_OperatingSystem WHERE Version like “10.0.10240” AND ProductType=”1″ AND OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “10.0.10240” AND ProductType=”1″ AND NOT OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “10.0.10240” AND ProductType=”1″

Windows 10 all builds

select Version from Win32_OperatingSystem WHERE Version like “10.%” AND ProductType=”1″ AND OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “10.%” AND ProductType=”1″ AND NOT OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “10.%” AND ProductType=”1″

Windows 7, 8 and 8.1 (all versions before 10)

select Version from Win32_OperatingSystem WHERE Version like “6.%” AND ProductType=”1″ AND OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “6.%” AND ProductType=”1″ AND NOT OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “6.%” AND ProductType=”1″

Windows 8.1

select Version from Win32_OperatingSystem WHERE Version like “6.3%” AND ProductType=”1″ AND OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “6.3%” AND ProductType=”1″ AND NOT OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “6.3%” AND ProductType=”1″

Windows 8

select Version from Win32_OperatingSystem WHERE Version like “6.2%” AND ProductType=”1″ AND OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “6.2%” AND ProductType=”1″ AND NOT OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “6.2%” AND ProductType=”1″

Windows 7

select Version from Win32_OperatingSystem WHERE Version like “6.1%” AND ProductType=”1″ AND OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “6.1%” AND ProductType=”1″ AND NOT OSArchitecture = “64-bit”
select Version from Win32_OperatingSystem WHERE Version like “6.1%” AND ProductType=”1″

 


Posted

in

, , , , ,

by

Tags:

Comments

8 responses to “Group Policy WMI filters for Windows 7/8/8.1/10”

  1. Chris

    I still get a syntax error even replacing all the quotes.

    Would these work as well?

    Win 7:
    select * from Win32_OperatingSystem WHERE Version like “6.1%” AND ProductType=”1″

    Win 10:
    select * from Win32_OperatingSystem WHERE Version like “10.%” AND ProductType=”1″

    Like

    1. thirdeye386

      oh wait this slows it down, eh? dang

      Like

    2. thirdeye386

      Oh I figured it out, just hadn’t had my coffee yet.

      each line has to be added separately. I was trying to add all three at one go.

      Liked by 1 person

  2. Matthew

    Any thoughts why on a domain functionality level 2008 R2 i would get a syntax error when copying and pasting any of your above filters in?

    Liked by 1 person

    1. Probably it could be the strange character “. When you cut and paste, try to first paste it into Notepad, and replace all “ with correct “.

      Like

  3. Christian

    Many thanks for this and a small update now 😉

    Windows 10 1703

    select Version from Win32_OperatingSystem WHERE Version like “10.0.15063” AND ProductType=”1″ AND OSArchitecture = “64-bit”
    select Version from Win32_OperatingSystem WHERE Version like “10.0.15063” AND ProductType=”1″ AND NOT OSArchitecture = “64-bit”
    select Version from Win32_OperatingSystem WHERE Version like “10.0.15063” AND ProductType=”1″

    Liked by 1 person

    1. Thanks! I will update the article later today

      Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.