set proxy autodiscovery with PowerShell in Windows 10/11

CorsaroDelVento 41 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 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,195 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,988 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,462 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dominique Schluep 320 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
    
    
    0 comments No comments

0 additional answers

Sort by: Most helpful