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

Posted by

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″

 

Advertisements

8 comments

  1. 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. 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. 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

Leave a Reply to Chris Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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