Backtrack:  
 
by lunarg on June 12th 2015, at 13:14

Attached to this article are scripts to configure proxy settings for Internet Explorer (all versions). As Google Chrome uses the IE settings for their proxy settings, it can be used for that browser as well. I know there are other, far better methods for configuring proxy settings for clients, but continue your read to see why they were not usable in this particular case.

I ran into a customer where they were still using Internet Explorer Maintenance in their group policies to configure proxy settings for their clients. As a result, all users who got more recent computers did not get the proxy settings, as they were running Internet Explorer 10 or newer. Starting from IE10, configuration of IE through IEM is no longer possible. There are alternatives: through Group Policy Preferences, or by using the Internet Explorer Administration Kit.

However, in our customer's case, GPP is unusable due to certain computers being too old or uncertain that they have support for GPP (before Vista SP2, it was a separate patch to install). The customer did not want to use IEAK, so this means we're left with one other solution: scripting.

The proxy settings for IE are stored in very specific registry values. As we can't rely on GPP to push the registry settings (otherwise, we could use GPP for the proxy settings by setting Internet Options in the first place), we need to resort to scripting to push the registry values. Hence, the creation of these scripts.

Variants

There are two variants of the script:

  • ProxyOnce.vbs : configures the proxy settings only once. The script checks this by checking whether the proxy settings have been set up before (through the presence of ProxyServer registry value). If it exists, the proxy settings will not be changed.
  • ProxyAlways.vbs : configures the proxy settings each time the script is run. You can use this variant to force the settings.

NOTICE: neither of the scripts are policy-based (the customer did not want that), so the user will still be able to change the settings themselves.

Usage

The scripts are to be used as user logon scripts in a group policy, but they can be used standalone as well. Before using, you need to edit the scripts so they match up with your network. At the start of the scripts, there are two variables to configure:

sProxyServer
Set the IP/hostname and port of your proxy server. Use the format hostname:port or ip-adres:port.
Example: proxy.domain.local:3128
sOverrides
A semi-colon (;) separated list of hostnames, domains, IP addresses and network ranges. Wildcards (*) can be used as well. To set the overrides list to exclude addresses in the same LAN subnet, add the phrase <local> at the end.
Example: *.domain.local;<local>

TODO: create policy-based variants of the script so users can't change the proxy settings during a session.