rss logo

How to Apply Group Policy to Windows 11, Servers or Desktops only

Microsoft Logo

It may be useful to be able to apply GPOs to a certain type of machines only. For example, you don't want the GPO that automatically shuts down the OS to be applied to servers. To meet this need, Microsoft offers a solution called WMI filter, so let's see how it works and how to create them!

Create a WMI Filter

  • Open the Group Policy Manager:
Opening the Group Policy Management Console (GPMC) using the Run dialog in Windows
  • Create a WMI filter:
Creating a new WMI filter in Group Policy Management Console (GPMC)
  • Give the filter a name and description, then click on 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 the WMI filter, here with the following parameters:
    • Version like "10.%" for Windows 10 and Windows 11
    • And ProductType="1" for desktops
WMI Query creation window in Group Policy Management Console, showing namespace and query fields for filtering Windows 10 operating systems
  • We can now link the WMI filter to a Group Policy. Open the GPO, in the WMI Filtering section, select the filter we've just created and click Open:
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 by clicking on Yes:
Confirmation dialog in Group Policy Management Console asking to change the WMI filter to Windows 10 with Yes and No options

Some examples of WMI Filters

  • Desktop computer only:
select * from Win32_OperatingSystem WHERE ProductType = "1"
  • Windows 11:
select * from Win32_OperatingSystem where Version like "10.0.2%" and ProductType="1"
  • Windows 10:
select * from Win32_OperatingSystem where Version like "10.0.1%" and ProductType="1"
  • Windows 7 or Vista:
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 DC:
select * from Win32_OperatingSystem where Version like "10.0.1%" and (ProductType="1" or ProductType="2") and OSArchitecture = "64-bit"

Parameters List

Here are some parameters to help to make your own filters.

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
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :

contact mail address