Registry

Changing Current User settings

Some registry items can be only managed at user level. If one wants to make some changes apply to all new users within system, default user profile must be altered. The script below shows how to achieve this using PowerShell:

# load the default user hive, name it as you wish
reg load HKU\DefaultUser c:\users\default\NTUSER.DAT

# add the properties you wish to set
New-ItemProperty "Registry::HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" -Force -Name "ProxyEnable" -Value 1 -Type DWORD
New-ItemProperty "Registry::HKU\DefaultUser\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" -Force -Name "ProxyServer" -Value "192.168.0.1:80" -Type String

# wait for operations to finalize and unload the hive
[gc]::collect()
[gc]::WaitForPendingFinalizers()
Start-Sleep -Seconds 30
reg unload HKU\DefaultUser