Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Add registry key to Default User Profile

Exported some registry keys to a filename.reg

Trying to use PDQ Deploy to apply the filename.reg to the Default User Profile HKU so all users logging onto the computer will have the keys in place.

So I've set three command lines in a package to try to achieve this:

cmd.exe /c reg.exe load HKU\DEFuser c:\users\Default\NTUSER.DAT

cmd.exe /c reg.exe import "\\server\filename.reg"

cmd.exe /c reg.exe unload HKU\DEFuser

The load and unload works, but the reg file seems to only apply to the current logged in user.

Saw the link below, but not sure how to change it to use a reg file 

http://www.adminarsenal.com/admin-arsenal-blog/modifying-the-registry-of-another-user/

 

Any recommendations?  Thanks!

0

Comments

4 comments
Date Votes
  • Make sure the entries in your filename.reg point to HKU\DEFuser. You could also use reg.exe directly:

    cmd.exe /c reg.exe add "HKU\DEFuser\something\something" /v "SomeValue" /d "SomeData" /t "SomeType" /f
    0
  • Ughhh......I feel stupid....

    I guess any changes will only be applied to users who have yet to log on and not to those who have already logged in.  

    I was logged in with the main administrator account to see if the registries would be there, but since I had logged in previously, the default profile would no longer apply to the main administrator account.  I tried logging in with a new account and it appears to have taken the reg file.

     

    Colby - I was thinking of using what you wrote, but how do you accommodate entries that have a really long hex number?

     

     

     

    0
  • If you want to modify existing user registry values take a look at this blog post: http://www.adminarsenal.com/admin-arsenal-blog/modifying-the-registry-users-powershell/

     

    Hex numbers are usually stored as REG_DWORD, so you would use

    ... /t "REG_DWORD" /d "0x1122AAFF"

     

    If you don't include the "0x" it will treat it as a decimal value and convert it to hex.



    If it's a really large value you may have to use REG_QWORD. https://msdn.microsoft.com/en-us/library/windows/desktop/bb773476(v=vs.85).aspx

    0
  • To apply such type of configuration, its allways better to utilize the logon script or group policy.
    This might help you to get on the right track http://blog.unidesk.com/gpos-set-custom-registry-entries-virtual-desktops-disabling-machine-password

    0