Windows 10 – Set Registry Keys Under Current User During OSDeploy Task Sequence

sccmwindows 10windows-registry

I have the TS setting the registry keys in the HKEY_Local_Machine no problem.

My issue is that I want to, by default, set a key for the HKEY_Current_User.
I want to have the "Automatically detect settings" in Internet Properties LAN settings unchecked, for anyone logging in.

I think that the correct key is

Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings

but as it is in the Current User I am finding it hard to have it set by default, through the OSDeploy TS. Want it set by default for a no-touch build of all our machines.

Any help would be appreciated.

Best Answer

Generally speaking this is more something you would control by a GPO than OSD but technically it is no problem.

What you have to do is modify the default user profile, i.e. the template from which all future profiles are created. The most basic way (and by far not the worst) to do this is using the built in tool REG.EXE First load the default user profile like this:

reg load "hku\Default" "C:\Users\Default\NTUSER.DAT" 

Next modify your key (binary data should be entered without spaces or seperator as the /d parameter):

reg add HKU\default\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections /v DefaultConnectionSettings /t REG_BINARY /d 460000... /f

Finally unload the hive

reg unload "hku\Default"

The biggest problem here is probably that you have got a binary key which is a little rough to manage.

You could work around this by loading the default user profile on a running machine (in the same location hku\default) with regedit. Then navigate to your path, modify the key and export it into a reg file. Then you could use

reg import <path to regfile>

in place of reg add.

Whichever way you find better, put those steps in a simple cmd and run with run command line during osd. In theory you could even do it directly in your reference image and thus bypass the need to do it during OSD at all. I would personally advise against such things however as this always means that a change in this setting is a complete rebuild of the reference image.

Related Topic