3

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:

enter image description here

Do you have any idea to help?

Elias Arellano
  • 433
  • 5
  • 16
  • 2
    HKCU doesn't exist until someone logs in and is a per user setting. Set it using Group Policy or as part of a login script process. – Scepticalist Feb 23 '21 at 11:31
  • @Scepticalist What shall I put on the script so? We can't use Groupe policy or credentials in our project. – Elias Arellano Feb 23 '21 at 13:46

0 Answers0