Windows: Resolve Policy Registry Keys to Group Policy Editor Entries (and vice versa)

Hi,

in Windows, local group policies could applied through the Group Policy Editor or simply by setting the Registry Keys under HKEY_LOCAL_MACHINE\Software\Policies, HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies and its equivalent in HKEY_CURRENT_USER.

Unfortunataly when just set the Registry Keys this isn’t shown in the GPO Editor and it’s hard to find the equivalent section and setting there.

This Script tries to resolve the Menu Position of a Policy in the GPO Editor by simply specifying it’s registry value. For example a key from Windows Update.


Key:       SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
Valuename: NoAutoUpdate 

Just call

PS C:> .\FindPolicyFromRegistryKey.ps1 -v NoAutoUpdate -p SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
RegistryKey       : SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
GPOEditPath       : Computer Configuration/Administrative Templates/Windows Components/Windows Updat
                     Updates
RegistryValueName : NoAutoUpdate
PolicyClass       : Machine
CurrentValue      : 1

Note: This will not work for all Polices. The file with the definition must reside in %Systemroot%\Policydefinition and complex structures may also not work. But for the most keys it works fine 🙂

Update 23.12.2015: Now the Script also supports a simple search for a keyword in all Policies. When setting the -s switch it loads all policies and enter an interactive mode for searching

PS C:> .\FindPolicyFromRegistryKey.ps1 -s
....
WinLogon.admx......
Winsrv.admx.
WordWheel.admx.
Policies loaded
Query (#quit to exit) :
Query: Proxy
 Found keyword "Proxy" in Policy:
  => /Administrative Templates/Windows Components/Internet Explorer/Internet C....
  => /Administrative Templates/Windows Components/Internet Explorer/Internet C....
  => /Administrative Templates/Windows Components/Internet Explorer/Internet C....
  => User Configuration/Administrative Templates/Windows Components/Internet E...

Update 1.0.9: In search mode the script shows also the registry key and the File where a policy is defined
Comments are welcome!

Michael

Powershell script searching keywords in Policies and resolve Policy Registry Keys to its Group Policy menu path.
19.0 KiB
1788 Downloads
Details...

Leave a Reply