Enabling internet proxy using powershell

If you are feeling lazy and not intersted in setting up Internet proxy on your server from UI then use the script below to enable and disable.  Nothing special but works.

To Enable the proxy

$ProxyServer = "proxy.com" $ProxyPort = "8080" $Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" $Proxy = $ProxyServer + ":" + $ProxyPort # Enable an explicit proxy Set-ItemProperty -Path $path -Name ProxyEnable -Value 1 #Enable the explicit proxy Set-ItemProperty -Path $path -Name ProxyServer -Value $Proxy #Configure the server settings

To Disable the Proxy

# Disable an explicit proxy
Set-ItemProperty -Path $path -Name ProxyEnable -Value 0 #Disable the explicit proxy
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s