rss logo

How to Target Group Policies to Windows 11, Servers, or Desktops

Microsoft Logo

In certain scenarios, you might need to apply Group Policy Objects (GPOs) only to specific types of computers. For instance, you probably wouldn't want a GPO designed to automatically shut down the operating system to target your servers. To address this, Microsoft provides a feature called WMI filters. Let's explore how they work and how you can create them effectively!

How to Create a WMI Filter

  • Open the Group Policy Management Console (GPMC):
Opening the Group Policy Management Console (GPMC) using the Run dialog in Windows
  • In the left pane, expand the domain, right-click on WMI Filters, and select New...:
Creating a new WMI filter in Group Policy Management Console (GPMC)
  • Provide a clear name and description for your new WMI filter, then click Add:
Creating a new WMI filter for Windows 10 in Group Policy Management Console, showing fields for name, description, and the option to add queries
  • Define your WMI filter query using appropriate parameters. For example, to target Windows 10 and Windows 11 desktops, enter:
    • Version like "10.%" to target both Windows 10 and Windows 11.
    • ProductType = "1" to select only desktop computers.
WMI Query creation window in Group Policy Management Console, showing namespace and query fields for filtering Windows 10 operating systems
  • Now, link your WMI filter to a Group Policy Object (GPO). To do this, select the GPO you want to filter, navigate to the WMI Filtering section, choose the filter you've just created from the dropdown list, and click OK:
Applying a WMI filter to a GPO in Group Policy Management Console, showing selection of the Windows 10 filter in the WMI Filtering section
  • Confirm your choice by clicking Yes when prompted:
Confirmation dialog in Group Policy Management Console asking to change the WMI filter to Windows 10 with Yes and No options

Examples of WMI Filters

  • Desktop Computers only:
select * from Win32_OperatingSystem WHERE ProductType = "1"
  • Windows 11 (Desktops):
select * from Win32_OperatingSystem where Version like "10.0.2%" and ProductType="1"
  • Windows 10 (Desktops):
select * from Win32_OperatingSystem where Version like "10.0.1%" and ProductType="1"
  • Windows 7 or Windows Vista (Desktops):
select * from Win32_OperatingSystem where (Version like "10.%" or Version like "6.0%") and ProductType="1"
  • Windows Server 2025:
select * from Win32_OperatingSystem where Version like "10.0.2%" and ProductType="3"
  • Windows Servers (Domain Controller Only):
select * from Win32_OperatingSystem where ProductType="2"
  • Windows Servers (Non-Domain Controller):
select * from Win32_OperatingSystem where ProductType="3"
  • Windows 10 64 bits or Windows 2016/2019 Domain Controllers:
select * from Win32_OperatingSystem where Version like "10.0.1%" and (ProductType="1" or ProductType="2") and OSArchitecture = "64-bit"

List of WMI Query Parameters

Below is a list of common parameters you can use to build custom WMI filters tailored to your needs:

Parameters
Desktops ProductType = "1"
Servers (Domain Controller Only) ProductType = "2"
Servers (Non-Domain Controller) ProductType = "3"
32 bits NOT OSArchitecture = "64-bit"
64 bits OSArchitecture = "64-bit"
Windows XP or Server 2003/R2 Version like "5.1%" or Version like "5.2%"
Windows Vista or Server 2008 Version like "6.0%"
Windows 7 or Server 2008R2 Version like "6.1%"
Windows 8 Server 2012 Version like "6.2%"
Windows 8.1 or Server 2012R2 Version like "6.3%"
Windows 10 or Server 2016/2019 Version like "10.0.1%"
Windows 11 or Server 2025 Version like "10.0.2%"
  • Note: Type "ver" in a terminal to display the Windows version.
Command Prompt showing Windows version information using the 'ver' command