Share via

set proxy autodiscovery with PowerShell in Windows 10/11

CorsaroDelVento 61 Reputation points
2024-03-08T12:12:57.22+00:00

I want to build PowerShell script which for Windows 10/11 domain computer, at user login, makes the following actions in "proxy" section of "Network & Internet" menu to autodiscovery wpad.dat file:

  • to set "Automatically detect settings"
  • to disable "Use setup script"
  • to disable "Use a proxy server"

Can you suggest what commands are need to create it?

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments

Answer accepted by question author

Dominique Schluep 410 Reputation points
2024-03-11T18:50:49.18+00:00

Hello CorsaroDelVento

Here's a script that should accomplish what you're looking for:

Function Set-ProxySettings {
    # Set "Automatically detect settings"
    Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyEnable -Value 0
    
    # Disable "Use setup script"
    Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyAutoConfigURL -Value ""
    
    # Disable "Use a proxy server"
    Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer -Value ""
}
Set-ProxySettings

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.