none
GPO issue while adding WMI filter

    Question

  • Hi,

    I have created a new WMI filter to apply for both WIn7 and Win10 PC's

    select * from Win32_OperatingSystem WHERE Version like "10.0%" or Version >="6.1" and ProductType = "1"

    But the GPO's are old which works fine on Win7, when I apply WMI filter created for both Win7 and WIn10 it works on Win7 PC but not on Win10

    Quick answer will be helpfull.

    Tuesday, September 27, 2016 1:53 PM

Answers

  • > select * from Win32_OperatingSystem WHERE Version like "10.0%" or
    > Version >="6.1" and ProductType = "1"
     
    Add parentheses to group "or" and "and" correctly. And I'd suggest to
    use the buildnumber string and not the version property, but that's
    rather cosmetical :)
     
    And on W10, run "wmic os get version" (or "wmic os get buildnumber") to
    see what value the OS reports (I have no W10 at hand right now...).
     
    • Proposed as answer by Todd Heron Wednesday, September 28, 2016 3:17 AM
    • Marked as answer by Jay GuModerator Wednesday, October 12, 2016 10:26 AM
    Tuesday, September 27, 2016 2:46 PM

All replies

  • > select * from Win32_OperatingSystem WHERE Version like "10.0%" or
    > Version >="6.1" and ProductType = "1"
     
    Add parentheses to group "or" and "and" correctly. And I'd suggest to
    use the buildnumber string and not the version property, but that's
    rather cosmetical :)
     
    And on W10, run "wmic os get version" (or "wmic os get buildnumber") to
    see what value the OS reports (I have no W10 at hand right now...).
     
    • Proposed as answer by Todd Heron Wednesday, September 28, 2016 3:17 AM
    • Marked as answer by Jay GuModerator Wednesday, October 12, 2016 10:26 AM
    Tuesday, September 27, 2016 2:46 PM
  • Hi Maddy,

    Try this:

    select * from Win32_OperatingSystem where Version like "10.%" or Version >="6.1" and ProductType = "1"

    In addition, if there are only Windows 7 and Windows 10 in your environment, you could configure WMI filtering like below.

    select * from Win32_OperatingSystem WHERE ProductType = "1"

    Here is an article below for your reference.

    Windows WMI Filter Strings

    http://social.technet.microsoft.com/wiki/contents/articles/31701.windows-wmi-filter-strings.aspx

    Best Regards,

    Jay


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, September 28, 2016 9:17 AM
    Moderator
  • Hi Martin, will try this and get back to you.. but will the parentheses make nay difference?
    Wednesday, September 28, 2016 1:45 PM
  • Hi Jay,

    Let me try Martins first and then try

    select * from Win32_OperatingSystem where Version like "10.%" or Version >="6.1" and ProductType = "1"

    Wednesday, September 28, 2016 1:46 PM
  • select * from Win32_OperatingSystem WHERE Version like "10.0%" "or" Version >="6.1" "and" ProductType = "1" -- I get syntex error.
    Wednesday, September 28, 2016 1:58 PM
  • > select * from Win32_OperatingSystem WHERE Version like "10.0%" "or"
    > Version >="6.1" "and" ProductType = "1" -- I get syntex error.
     
    Hm - braces, I meant braces :-)
     
    Wednesday, September 28, 2016 2:08 PM
  • Hi,

    Are there any updates?

    If the reply above has resolved your problem, please mark it as answer as it would be helpful to anyone who encounters the similar issue.

    Thank you.

    Best Regards,

    Jay


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, October 11, 2016 2:06 AM
    Moderator