Search code examples
windowsregistry

How do you find a corresponding registry value to a setting in gpedit.msc?


My question is, how do I find the location of the registry value that corresponds to a gpedit.msc setting. I know that there are some references on technet, but they are outdated.

For instance, if I were to try to modify the setting, configure automatic updates, through regedit, how would I be able to find the location of its value in the windows registry? Is there some kind of area in gpedit that will tell me its location?


Solution

  • I had the same problem and the solution I found was using PowerShell with the PolicyFileEditor module. As far as PowerShell goes this is quite simple so don't worry about that. Taking it step by step this is what you have to do:

    Start PowerShell in administrator mode

    #Look up the module paths (you will probably get 3)
    PS> $env:PSModulePath
    
    #make sure you have the NuGet package
    PS> Install-PackageProvider -Name NuGet -Force
    
    #Enter the path with your username in it at the <path>
    #(This only works if you have 
    PS> Save-Module -Name PolicyFileEditor -Path <path>
    
    #Install the module
    PS> Install-Module -Name PolicyFileEditor
    
    #Get the machine policy registry value's
    Get-PolicyFileEntry -Path "$env:windir\system32\GroupPolicy\Machine\registry.pol" -all
    
    #Get the user policy registery valeu's
    Get-PolicyFileEntry -Path "$env:windir\system32\GroupPolicy\User\registry.pol" -all
    

    If this all works correctly than you should get something like this (Depend on gpedit settings): :)

    The PolicyFileEditor is quite handy as it can also export the gpedit registry settings and then import them, look here for more information. For more information on PowerShell itself I recommend the Microsoft virtual academe course.

    There is however one problem with the PolicyFileEditor module and that is that while you can edit the registry these changes do not show up in the gpedit and you have to restart the computer for the changes to take effect (try testing with windows defender or something similar)

    EDIT: after testing some more the LPG settings started showing up (After restart), i don't know what is up but you will have to test it for yourself.

    Good luck.