'*********** 7-Internet Explorer Proxy Settings
'This section will set proxy settings for Internet Explorer based on IP addresses
Set IPConfigSet = objWMIService.ExecQuery _
("Select IPAddress from Win32_NetworkAdapterConfiguration ")
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) _
to UBound(IPConfig.IPAddress)
If IPConfig.IPAddress(i) = "0.0.0.0" Then
Else
strIPAdd = IPConfig.IPAddress(i)
End If
Next
End If
Next
'Don't Set Proxy Settings if machine is a VPN user, if not, set Default to Interal Proxy
If Left(strIPadd,7) = "172.27." Then
strProxy = ""
Else
'Do Nothing
End If
'Set Proxy Settings for 6 digit subnets
Select Case Left(strIPadd,6)
Case "10.10." strProxy = "[URL unfurl="true"]http://foo.com/proxy.pac"[/URL]
Case "10.48." strProxy = "[URL unfurl="true"]http://foo.com/proxy.pac"[/URL]
Case "10.49." strProxy = "[URL unfurl="true"]http://foo.com/proxy.pac"[/URL]
Case "10.64." strProxy = "[URL unfurl="true"]http://foo.com/proxy.pac"[/URL]
Case "10.65." strProxy = "[URL unfurl="true"]http://foo.com/proxy.pac"[/URL]
End Select
'Set Proxy Settings for 9 digit subnets
If Left(strIPadd,9) = "10.65.37." Or Left(strIPadd,9) = "10.65.38." Then
strProxy = "[URL unfurl="true"]http://otherproxy.foo.com/proxy.pac"[/URL]
Else
End If
'Set default proxy to foo.com Proxy as long as user is not at a VPN Site
If strProxy = emtpy AND (NOT Left(strIPadd,7) = "172.27.")Then
strProxy = "[URL unfurl="true"]http://mel-proxy.americanhm.com/proxy.pac"[/URL]
Else
'Do Nothing
End If
'Write Proxy Registry Settings
'Check for existence of Internet Settings subkey
If RegKeyExists("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\") Then
'Do Nothing
Else
objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\","","REG_SZ" 'Create if not there
End If
objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable","0","REG_DWORD"
objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyHttp1.1","1","REG_DWORD"
objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL","","REG_SZ"
objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL",strProxy,"REG_SZ"
objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer","","REG_SZ"
objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\EnableAutoproxyResultCache","1","REG_DWORD"
'Check for existence of Internet Explorer subkey
If RegKeyExists("HKCU\Software\Policies\Microsoft\Internet Explorer\") Then
'Do Nothing
Else
objShell.RegWrite "HKCU\Software\Policies\Microsoft\Internet Explorer\","","REG_SZ" 'Create if not there
End If
'Check for existence of Control Panel subkey
If RegKeyExists("HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\") Then
'Do Nothing
Else
objShell.RegWrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\","","REG_SZ" 'Create if not there
End If
objShell.RegWrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\Proxy","1","REG_DWORD"
objShell.RegWrite "HKCU\Software\Policies\Microsoft\Internet Explorer\Control Panel\AutoConfig","1","REG_DWORD"