We have a script that sets manual proxy on Windows Server 2016, so we execute the following commands:
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyServer -Value "$($server):$($port)"
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyEnable -Value 1
That works well when executing it manually as a script.ps1 file, but not working when Azure Policy deploys it with DeployIfNotExists method. On the other hand, custom script extension agent is deploying sucessfully. There are some other commands on this script, they are executing successfully. Just Set-ItemPorperty doesn't work. When we connect to the machine, we don't see any change. Here is the screenshot of the config that we want to change:
Do you have any idea to help?