Set Registry Permissions

less than 1 minute read


This function will take ownership of a registry key as a specified user and set access rights to full control. This is a useful function to call in other scripts when you get “Access Denied” when trying to modify certain keys in the registry.

To Resolve:

  1. Before:

    • set-reg-1
  2. After running Set-RegkeyPermissions -RegistryKey "HKCU:\Gerry\NoAccess" -Username "gerry"

    • set-reg-2
  3. Source is maintained under gwConfiguration