Skip to content
Tutorials Center
My learning

Topics

Lesson 22 of 38 ยท Group Policy and Management

Security Filtering, WMI Filters, Preferences and Loopback

Control exactly who gets a Group Policy: security filtering permissions, WMI filters, item-level targeting in Group Policy Preferences and user-group loopback processing.

Linking decides where a GPO is considered. Filtering decides who really receives it. Active Directory gives you three tools for narrowing a GPO: security filtering with permissions, WMI filters that test properties of the computer, and item-level targeting inside Group Policy Preferences. A fourth feature, loopback processing, changes which user settings apply on a given machine, which is essential for kiosks and shared computers.

None of these tools can run on this site, so the Windows steps are described, and the decision logic is modelled with Python.

Security filtering

Every GPO has a permissions list. A GPO applies to a user or computer only if that account has both of these permissions on the GPO:

  • Read
  • Apply group policy

By default the GPO's scope is Authenticated Users, so it applies to everyone in the linked OU. To narrow it, you remove Authenticated Users from the Security Filtering list in GPMC and add the specific groups or accounts that should receive the GPO.

To exclude a group instead, you leave Authenticated Users in place and add a Deny entry for Apply group policy for the group on the Delegation tab. A deny always wins over an allow, so a member of the excluded group is skipped even if it is also in an allowed group.

The MS16-072 change

Since the 2016 security update, user policies are retrieved using the computer's security context. If you remove Authenticated Users and give Read only to a user group, the computer account can no longer read the GPO and user settings fail to apply. The fix is to keep Read for Authenticated Users (or for Domain Computers) on the Delegation tab, and use Apply group policy only for the intended group. This is a very common surprise.

Python Does this GPO apply? (permission model)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

WMI filters

A WMI filter is a query written in WQL (WMI Query Language) that is evaluated on the client. The GPO applies only if the query returns at least one result. Examples (read-only; they run on Windows):

TEXT
SELECT * FROM Win32_OperatingSystem WHERE Version LIKE "10.%" AND ProductType = "1"
SELECT * FROM Win32_ComputerSystem WHERE Manufacturer = "LENOVO"
SELECT * FROM Win32_Battery

The first matches Windows 10 and 11 client machines (ProductType 1 is a workstation, 2 is a domain controller and 3 is a server). The last matches only machines with a battery, which is a cheap way to target laptops.

WMI filters are powerful but have costs. They run on every refresh, a slow query delays sign-in, and they apply to the whole GPO, not individual settings. Use them sparingly and prefer OU structure or security groups when possible. One filter can be linked to many GPOs, and a GPO can have only one filter.

Python A WMI-style filter evaluator (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Group Policy Preferences and item-level targeting

Classic policy settings enforce: the user cannot change them, and removing the GPO removes the setting. Group Policy Preferences (GPP) configure: they set a value once (or keep re-setting it), but the user may often change it, and the setting can stay after the GPO is removed. Preferences cover drive maps, printers, scheduled tasks, files, folders, registry items, environment variables and shortcuts.

Each preference item has an action: Create, Replace, Update or Delete. It also supports item-level targeting, a rule such as "only if the user is in group Finance AND the computer is a laptop AND the IP is in subnet 10.20.0.0/16". This lets one GPO contain many precise items, for example several drive maps for different departments, with no extra GPOs.

Never store passwords in preferences. Older versions allowed "cpassword" fields, which are encrypted with a published key and so effectively readable by any domain user. They were removed for good reason, and any leftover XML in SYSVOL with cpassword should be cleaned up.

Loopback processing

Normally user settings follow the user. In a classroom, kiosk or terminal server you instead want settings to follow the computer, whoever signs in. User Group Policy loopback processing mode (a computer setting) does this, with two modes:

  • Replace: the user's own GPO list is ignored. Only the user settings from GPOs that apply to the computer are used.
  • Merge: the user's normal settings apply first, then the computer's user settings are applied on top, so the computer wins on conflict.
Python Loopback replace versus merge

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

In Replace mode the user loses the H: drive map; in Merge mode they keep it, but the kiosk wallpaper and locked start menu still win.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which two permissions must an account have on a GPO for it to apply?

    Read plus Apply group policy are required. Edit permissions are for administrators who change the GPO.
  2. 2. After removing Authenticated Users from security filtering, user settings stop applying. What is the usual fix?

    After MS16-072 the computer account must be able to read the GPO even when the user settings are being processed.
  3. 3. A kiosk should always show the same desktop regardless of who signs in. Which feature fits?

    Replace-mode loopback ignores the user's own GPOs and applies the user settings that target the computer.
  4. 4. Which statement about WMI filters is true?

    A GPO has at most one WMI filter, it is evaluated on every refresh on the client, and it controls the whole GPO.
  5. 5. What is wrong with a Group Policy Preference that sets a password in a cpassword field?

    Microsoft published the AES key, so cpassword values are effectively plain text to anyone who can read SYSVOL.

Summary

  • Security filtering uses Read plus Apply group policy; a Deny entry always wins.
  • Keep Read for computers so user policy still works after filtering.
  • A WMI filter is a WQL query on the client; use it sparingly.
  • Preferences configure rather than enforce, and item-level targeting makes one GPO precise.
  • Loopback Replace and Merge make user settings follow the computer.

Next: Troubleshooting Group Policy