Jump to content

Recommended Posts

Posted

I've had a look for some sort of program or other script to change proxy settings in IE but can't find anything to do exactly what I want.

 

So far I've got:

 

Option Explicit

Dim objShell

Dim strProxyenable, strProxy

 

strProxyenable = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"

strProxy = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer"

 

Set objShell = CreateObject("WScript.Shell")

 

strProxyenable = objShell.RegRead(strPRoxyenable)

 

If strProxyenable = 1 then

'Turn it off

objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable","0","REG_DWORD"

objShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer"

objshell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride"

Wscript.Echo "Proxy Disabled"

WScript.Quit

else

'Turn it on

objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable","1","REG_DWORD"

objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer","address_here:1080","REG_SZ"

objshell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride","*.wayland.local;10.104.64.*;10.104.65.*;server03;wserver01","REG_SZ"

Wscript.Echo "Proxy Enabled"

wscript.quit

end if

 

 

Which works but it doesn't check the box labelled "Bypass proxy server for local addresses"

 

Ben

  • Thanks 1
Posted

grr hehe fixed it myself just after posting.

 

You need to add to the list of local addresses and it then enables the check box.

 

So that line becomes:

 

objshell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride","*.wayland.local;10.104.64.*;10.104.65.*;server03;wserver01","REG_SZ"

Posted

AutoIT:

 

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "First Home Page", "REG_SZ", "http://moodle.st-johns.org.uk/")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page", "REG_SZ", "http://moodle.st-johns.org.uk/")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ", "10.0.0.2:8080")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "Proxyenable", "REG_DWORD", "1")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyOverride", "REG_SZ", "intranet")
Run('C:\Program Files\Internet Explorer\iexplore.exe')

Posted
Ok i admit i havent looked at the script yet so i dont fully know what you are doing but can't you just do all this through gpo...
Posted

No because the point is that teachers want to use their laptops at home thus I need to be able to turn the proxy settings on and off.

 

This script turns the setting off if it's on and on if it's off, so they just need to double click it at home to turn it off then double click when they come back to school to turn it on.

 

I can't rely on gpo settings reapplying at school.

 

Ben

Posted
No because the point is that teachers want to use their laptops at home thus I need to be able to turn the proxy settings on and off.

 

This script turns the setting off if it's on and on if it's off, so they just need to double click it at home to turn it off then double click when they come back to school to turn it on.

 

I can't rely on gpo settings reapplying at school.

 

Ben

 

That should be straight forward in AutoIT - just create a GUI with two buttons on......

I think you already have it sorted though.....

Posted
No because the point is that teachers want to use their laptops at home thus I need to be able to turn the proxy settings on and off.

 

Ben

 

Just a thought, but if you configure wpad on the school network, you can then just tick auto, and the proxy magically changes from home to school.

 

It needs a webserver on the school network and a javascript file with the settings it.

 

This assumes one proxy per school though.

 

RobK

Posted
I did the same recently, thought the script seems to be a bit slow.

 

What about FF?

 

You should be able to edit the prefs.js in the users profile for that - [ I use a basic launch script which copies over some default profile settings before ff launches for our users ]

  • Thanks 1
Posted

The script I've put together changes the correct registry keys for the user however even though I've set everything possible in my gpos to make the proxy settings per user the browser still appears to be using the machine specific proxy settings.

 

Ben

Posted
why dont you just export the settings from regedt32 with proxy on and proxy off(search the registry for the exact part) and save to desktop will allow them to turn proxy on and off easily
Posted

ffs because that won't work either, the script I've written works fine and it changes those registry values fine.

 

However it appears that even though I've changed everything I can find in the gpo's to set per use proxy settings that the pc's are using per machine settings.

 

I run the script once to disable the proxy settings and using regedit the values get changed correctly but IE still shows proxy settings that exist in the local_machine registry.

 

Ben

Posted

Just a thought,

 

You don't have a kix script running at logon that is setting the proxy do you.

 

I only ask as this has caught me out in a norfolk school that the LEA had setup. They had the settings set on both gpo and a logon kix script.

Posted

I've added the HKLM registry key that contains the per machine proxy settings to a gpo to enable users to change it and voila my script works.

 

Even thought everything is set to do per user proxy settings they are still reading machine ones, gpo's are being applied as the security settings in the one I just edited obviously applied to let me change the registry.

 

Ben

Posted

Being far too lazy to script things, I use Proxyswitcher Lite for IE and the Quickproxy Add-on for FF (well in the latter case, for my lappy).

 

It only helps a little - I still get calls that "the internet is broken" only to find that they haven't switched the proxy to "School" (it's a simple right-click the tray icon and select, btw) or that they have somehow deleted the "School" proxy entry.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...