Windows: remove "managed by your organization" policies from the registry
Clean policy registry keys and local policy folders, including for another user through HKEY_USERS.
This note explains how to remove "managed by your organization" policies from the Windows registry, including for another user profile, and which locations to clean.
Edit the registry of another user
HKEY_CURRENT_USER only maps to the logged-on user. To edit another user's hive:
- Find the user's SID under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList. - Use the same SID as a sub-key of
HKEY_USERS.
Mount HKEY_USERS as a PowerShell drive:
New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS
Set-Location -Path 'HKU:\'
Example SID used below (placeholder): S-1-5-21-0-0-0-1001.
Disable RunLogonScriptSync
Set-ItemProperty -Path HKU:\S-1-5-21-0-0-0-1001\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name RunLogonScriptSync -Value 0 -Force
Remove all policies
Delete the content of these keys.
Current user:
HKEY_CURRENT_USER\SOFTWARE\Policies
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies
HKEY_CURRENT_USER\System\CurrentControlSet\Policies
Local machine:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Policies
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Policies
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Policies
Reference: How to remove "This setting is managed by your organization".
Delete the local group policy folders
Enable hidden files in Explorer, then, with administrator rights, delete the GroupPolicy and GroupPolicyUsers folders under \Windows\System32\.
Registry value types
| Type | PowerShell name |
|---|---|
| REG_SZ | String |
| REG_DWORD | DWord |
| REG_QWORD | QWord |
| REG_MULTI_SZ | MultiString |
| REG_BINARY | Binary |
Notes
- Back up the registry before deleting keys.
- Policies applied by Active Directory are re-applied at the next refresh; this only cleans the local state.