Export (0) Print
Expand All

Create the WMI Filters

Updated: December 16, 2008

Applies To: Windows Server 2008

Use this procedure to create the WMI filters that are used to restrict the application of a GPO to the computers in the membership group that are running the version of Windows for which the GPO is intended.

Membership in Domain Admins is the minimum required to complete this procedure.

  1. Log on to your domain controller as a member of the Domain Admins group.

  2. Click Start, and then click Server Manager.

    The Server Manager console opens.

  3. In the navigation pane, expand Features, expand Group Policy Management, expand Forest: your forest name, expand Domains, expand your domain, and then click WMI Filters.

  4. Click Action, and then click New.

  5. In the New WMI Filter dialog box, in Name, type the name of the filter. Use a name that indicates the target group (for example, Windows Server 2008).

  6. In Description, type the purpose of the filter.

  7. Click Add.

    The WMI Query dialog box appears.

  8. In Query, type the WMI Query Language (WQL) string that returns TRUE when applied to the correct version of Windows. For example, for Windows Server 2008 type:

    select * from Win32_OperatingSystem where Version like "6.0%" and ProductType = "3"
    

    Both Windows Server 2008 and Windows Vista return version numbers that begin with 6.0. To differentiate between the client and server versions, include the clause to check the ProductType field. This value returns 1 for client versions of Windows such as Windows Vista, 2 for server versions of Windows operating as domain controllers, and 3 for server versions of Windows that are not operating as domain controllers.

  9. Repeat step 8 for each of the other versions of Windows. The following table shows sample query statements for each version.

     

    WMI Filter Name WQL Query Statement

    Windows Vista

    select * from Win32_OperatingSystem where Version like "6.0%" and ProductType = "1"

    Windows Server 2003

    select * from Win32_OperatingSystem where Version like "5.2%" and ProductType = "3"

    Windows XP

    select * from Win32_OperatingSystem where (Version like "5.1%" or Version like "5.2%") and ProductType = "1"

    Windows 2000

    select * from Win32_OperatingSystem where Version like "5.0%"

    noteNote
    The filter for Windows 2000 is used to prevent computers that are running later versions of Windows from applying the GPO. You cannot use a WMI filter to apply a GPO to computers that are running Windows 2000 because that version of the operating system does not support WMI filters.

    You can also create combination filters when required by your design. The following table shows query statements for common operating system combinations.

     

    WMI Filter Name WQL Query Statement

    Windows Vista and Windows Server 2008

    select * from Win32_OperatingSystem where Version like "6.0%" and ProductType<>"2"

    Windows Server 2003 and Windows Server 2008

    select * from Win32_OperatingSystem where (Version like "5.2%" or Version like "6.0%") and ProductType="3"

    Windows 2000, XP and 2003

    select * from Win32_OperatingSystem where Version like "5.%" and ProductType<>"2"

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft