Announcement

Collapse
No announcement yet.

GPO WMI filtering not working

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • GPO WMI filtering not working

    I have a GPO which I want to only apply to servers so I set up a WMI filter with the following 3 scripts:


    select * from Win32_OperatingSystem WHERE Version LIKE "5.2%" AND ( ProductType = "2" or ProductType = "3" )


    select * from Win32_OperatingSystem WHERE Version LIKE "6.0%" AND ( ProductType = "2" or ProductType = "3" )


    select * from Win32_OperatingSystem WHERE Version LIKE "6.1%" AND ( ProductType = "2" or ProductType = "3" )

    The above scripts should apply to Server 2003, Server 2008 & Server 2008 R2 domain controllers & member servers. However when I test the GPO it doesn’t appear to be working.

    If I just have x1 of the scripts in the filter they all work fine independently.

    Does anyone know why this is not working with all the scripts on the filter?

  • #2
    Re: GPO WMI filtering not working

    Originally posted by Deland01 View Post
    I have a GPO which I want to only apply to servers so I set up a WMI filter with the following 3 scripts:


    Code:
    select * from Win32_OperatingSystem WHERE Version LIKE "5.2%" AND ( ProductType = "2" or ProductType = "3" )
    
    select * from Win32_OperatingSystem WHERE Version LIKE "6.0%" AND ( ProductType = "2" or ProductType = "3" )
    
    select * from Win32_OperatingSystem WHERE Version LIKE "6.1%" AND ( ProductType = "2" or ProductType = "3" )
    The above scripts should apply to Server 2003, Server 2008 & Server 2008 R2 domain controllers & member servers. However when I test the GPO it doesn’t appear to be working.

    If I just have x1 of the scripts in the filter they all work fine independently.
    Does anyone know why this is not working with all the scripts on the filter?

    No single machine can pass all three conditions and therefore the policy will never be applied.

    You should create a WMI-filter containing a single "WHERE" clause for this WMI class and use the OR operator, instead of using the three "WHERE" clauses.
    sample;
    Code:
    select * from Win32_OperatingSystem WHERE (Version LIKE "5.2%" OR Version LIKE "6.0%" OR Version LIKE "6.1%") AND (ProductType = 2 OR ProductType = 3)
    /Rems
    Last edited by Rems; 12th April 2012, 20:02.

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: GPO WMI filtering not working

      Rems - Thanks for this I had a feeling it was something simple in the script.

      Have some points
      Last edited by Deland01; 14th April 2012, 15:04. Reason: typo change

      Comment

      Working...
      X