A local group policy intended for standalone Windows 11 devices. It aims to improve privacy, security, and performance, in that order.
All settings are maintained in a single Win11.PolicyRules
file that is applied with LGPO. Security features that send data to Microsoft, such as SmartScreen, are disabled, deviating from Microsoft's Security Baseline. Some settings are only effective on the Enterprise and/or Education editions.
The target Feature Update version is Windows 11 24H2. This prevents automatic updates to the next release before the policy is updated with new settings.
Releases are tagged using SemVer 2.0 format where MAJOR.MINOR
is the target Windows feature update version (e.g. 24H2
is 24.2
) and PATCH
is the policy revision.
All scripts must be run as an Administrator.
Run install.cmd
and restart the computer to install Win11.PolicyRules
as the local group policy. This does not clear out any existing settings. Run reset.cmd
first to start with a clean slate.
Run save.cmd <out-file> <policy-name>
or savewin11.cmd
(creates Win11-Local.PolicyRules
) to save the local group policy as a PolicyRules
file. Warning: This will overwrite the contents of C:\GPO
.
Run reset.cmd
followed by gpupdate /force
or a restart to clear out the local group policy.
Download and use the Policy Analyzer to compare PolicyRules
files. Make sure you configure it to use the repository's PolicyDefinitions
directory rather than C:\Windows\PolicyDefinitions
.
When LGPO.exe
and GPO2PolicyRules.exe
export the local policy, they include many default settings that shouldn't be overwritten when applying the resulting PolicyRules
file. There is also a bug in handling (Default)
registry values. These are annoyances that prevent a clean install/save roundtrip and add noise when comparing against Microsoft's Security Baseline. Default settings were manually removed from Win11.PolicyRules
by doing a three-way comparison between it, MSFT-Win11-*.PolicyRules
, and Win11-Clean-*.PolicyRules
. The easiest way to do this is by removing all ComputerConfig
and UserConfig
entries, and then comparing all three files with Policy Analyzer. To avoid reverting these edits, any updates to the policy must be merged in manually:
- Use
gpedit.msc
to modify the local policy. - Run
savewin11.cmd
to createWin11-Local.PolicyRules
file (not version-controlled). - Diff and copy the relevant settings to
Win11.PolicyRules
. IgnoreSecurityTemplate
changes unless those were actually modified. Be sure to check for newCSE-Machine
andCSE-User
entries.
To update the policy for a new Windows feature release:
- Download the latest ISO.
- Check for updates to LGPO and Policy Analyzer tools.
- Rebuild
PolicyDefinitions
directory as described in the next section and update README.md with new version information. - Create a new Hyper-V VM and do a clean install.
- Configure VM enhanced session settings to redirect the host drive that contains this repository.
- Run
cmd.exe
as an Administrator in the VM. - Map host drive for easier access:
net use Z: \\tsclient\<drive>\<path-to-repo>
- Run
Z:\savewin11.cmd
and renameZ:\PolicyRules\Win11-Local.PolicyRules
toZ:\PolicyRules\Win11-Clean-vXXH2.PolicyRules
. - Run
Z:\install.cmd
, restart, and remapZ:
. - Copy updated
Z:\PolicyDefinitions
directory to the VM, skipping all existing files. - Use Policy Analyzer to view differences between the old and new Security Baselines.
- Follow the steps above to update the policy via
gpedit.msc
. - Update
Computer Configuration → Windows Components → Windows Update → Manage updates offered from Windows Update → Select the target Feature Update version
. - Use Policy Analyzer to view and resolve any additional differences between
MSFT-Win11-vXXH2.PolicyRules
andWin11.PolicyRules
.- Do not copy settings directly. Always use
gpedit.msc
to make changes, followed bysavewin11.cmd
, and merge fromWin11-Local.PolicyRules
. - In general, always set a value for any setting in the Security Baseline, even if it's the default. Conflicts are easier to review, whereas if a setting is missing, it's not clear whether it is new or was omitted intentionally. Exceptions are Internet Explorer, LAPS, and Attack Surface Reduction policies, which are not used, and a few other settings that can't be set.
- Do not copy settings directly. Always use
- Reapply the updated policy on the VM and make any additional changes as needed. See Security Baseline
Documentation\Windows 11 XXH2 to XXH2 Delta.xlsx
for information about new settings.
Templates contained in the PolicyDefinitions
directory:
- Windows 11 Enterprise 24H2 Sep 2025 ISO (26100.6584)
- SHA256:
78441899DCB2F557FD322B5A1B169A57F7D64771BFD2C5B0FE313DB11EC06BA6
- SHA256:
- Windows 11 v24H2 Security Baseline
- Windows Restricted Traffic Limited Functionality Baseline - Windows 11 23H2
- Microsoft Edge (140.0.3485.66)
- Mozilla Firefox (7.3)
Before editing the policy with gpedit.msc
, copy the templates to C:\Windows\PolicyDefinitions
. Overwriting existing files is not recommended because it requires ownership changes, which makes SFC unhappy, which may break Windows Update. In general, it's better to start with a VM running a matching version of Windows. For each new release, the PolicyDefinitions
directory should be rebuilt from scratch by copying the templates over in the listed order to ensure removal of outdated templates.
To extract PolicyDefinitions
from a Windows ISO:
- Mount the ISO file.
- Open
sources\install.wim
with 7-Zip. - Check
[1].xml
for the appropriate image index and build version. - Extract
\<N>\Windows\PolicyDefinitions
. - Record
BUILD
andSPBUILD
versions.
- Local Administrator is disabled and renamed to LocalAdmin. The password must be set before it can be enabled or you'll get error 7016 in
gpresult /h
report along with "Security has requested to process its policy settings again" message. - Microsoft Account sign-in is disabled. Do not disable "Microsoft Account Sign-in Assistant" service (aka "wlidsvc") as suggested by the Restricted Traffic Baseline. Doing so results in error 0x80070426 when running Windows Update.
- Disabling active Network Connectivity Status Indicator (NCSI) tests breaks Windows Update (0x800704cf), DISM (0x800f0906 or 0x800f081f), and probably other things. Passive-only configuration doesn't fix this, so it's best to leave both passive and active tests enabled. Windows Update error only happens once if Windows was installed without any network connectivity. After a single successful update, disabling NCSI doesn't seem to cause further problems, but DISM will still run into errors. Guess how many days it took to figure this out.
- "Turn off all Windows spotlight features" policy must be applied within 15 minutes after Windows is installed (was true for Windows 10, no longer the case for Windows 11?).
LGPO.exe
has a known bug with importingREG_MULTI_SZ
values literally rather than converting\0
escape sequences into a separator, so these values cannot be added toWin11.PolicyRules
file.
The following registry entries do not have an associated template and are treated as preference-type settings that are not removed automatically when no longer applied by the policy:
DisableWpad=1
andAutoDetect=0
disable automatic proxy detection (WPAD). Do not disable "WinHTTP Web Proxy Auto-Discovery Service" (aka "WinHttpAutoProxySvc") - doing so will break things.HKCU\Software\Classes\CLSID\{86CA1AA0-34AA-4E8B-A509-50C905BAE2A2}\InprocServer32
key restores classic File Explorer context menus.HideFileExt=0
shows all file extensions in File Explorer.ShowSyncProviderNotifications=0
disables sync provider notifications, which are used to show Microsoft ads in File Explorer.ScoobeSystemSettingEnabled=0
disables "Let's finish setting up your device" notification (Settings > System > Notifications > Additional settings > Suggest ways to get the most out of Windows and finish setting up this device).IsResumeAllowed=0
disables cross device resume.Start_IrisRecommendations=0
disables "Show recommendations for tips, shortcuts, new apps, and more" Start setting.
Firefox is configured using a combination of managed policies and JSON preferences (copied to the Preferences (JSON on one line) policy setting in minified format). See the following links for detailed setting information:
- Firefox Policy Templates
- How to stop Firefox from making automatic connections
- brainfucksec/user.js
- arkenfox/user.js
Preferences setting does not support the app.*
prefix, so false
values for app.normandy.enabled
and app.shield.optoutstudies.enabled
are not applied. Also, the one line minified REG_SZ
format must be used because LGPO.exe
has a bug in handling \0
separators in REG_MULTI_SZ
values.
LGPO.exe
writes CSE-Machine
and CSE-User
entries to C:\Windows\System32\GroupPolicy\GPT.INI
. The format of the resulting gPCMachineExtensionNames
and gPCUserExtensionNames
values is [{CSE1}{Tool1}{Tool2}...][{CSE2}...]...
. It's not clear whether tool extension GUIDs are important for correct policy enforcement (if you know, please message me). LGPO.exe
only adds an undocumented DF3DC19F-F72C-4030-940E-4C2A65A6B612
tool GUID for all entries when applying a PolicyRules file. The following table lists tool GUIDs that are normally set when the policy is configured via gpedit.msc
:
CSE | Tool GUID | Added By |
---|---|---|
{35378EAC-683F-11D2-A89A-00C04FBBCFA2} |
{B05566AC-FE9C-4368-BE01-7A4CBB6CBA11} |
Windows Defender Firewall with Advanced Security |
All registry computer CSEs | {D02B1F72-3407-48AE-BA88-E8213C6761F1} |
Computer Administrative Templates |
All registry user CSEs | {D02B1F73-3407-48AE-BA88-E8213C6761F1} |
User Administrative Templates |
{F3CCC681-B74C-4060-9F26-CD84525DCA2A} |
{0F3F3735-573D-9804-99E4-AB2A69BA5FD4} |
Advanced Audit Policy Configuration |
See [MS-GPSO].pdf for additional CSE and Tool Extension GUIDs.
To refresh CSE configuration, removing any extensions that are no longer needed by the current policy:
- Delete
C:\Windows\System32\GroupPolicy\GPT.INI
file. - Open
gpedit.msc
and filter Computer Administrative Templates to show only Configured settings (set Managed and Commented to "Any" and clear all checkboxes). - Open "All Settings" container and double-click on the first setting.
- For each setting, toggle Enabled/Disabled via Alt-E/Alt-D shortcuts, which will force
gpedit.msc
to re-apply it, and then go to the next setting via Alt-N.- You may occasionally see "The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)" error. Just repeat the operation for the current setting and keep going.
- "Join Microsoft MAPS" and "Limit optional diagnostic data for Desktop Analytics" show up as Disabled, but must actually be set to Enabled and then configured via the drop-down control.
- Repeat for all User settings.
- Expand Windows Settings → Security Settings and toggle one setting under Security Options, Windows Defender Firewall with Advanced Security, and Advanced Audit Policy Configuration.
- Extract the resulting CSEs from
GPT.INI
.