+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
Windows Thread, script to set proxy server in Technical; Hi We have laptops that are used in school and at home. I would like a method to set the ...
  1. #1

    Join Date
    Feb 2008
    Posts
    325
    Thank Post
    51
    Thanked 3 Times in 3 Posts
    Rep Power
    14

    script to set proxy server

    Hi

    We have laptops that are used in school and at home. I would like a method to set the proxy server when in school and automatic when at home. What would the best method to do this.

    Thanks in advance

  2. #2

    Join Date
    Feb 2013
    Location
    South West England
    Posts
    169
    Thank Post
    0
    Thanked 29 Times in 28 Posts
    Rep Power
    31
    We use 2 batch files that enables/disables the proxy registry key and then starts IE.

    Then we just put 2 shortcuts on the desktop - Internet @ Home and Internet @ School.

    Pretty straight forward for the teachers.

  3. #3
    jamesfed's Avatar
    Join Date
    Sep 2009
    Location
    Reading
    Posts
    2,202
    Thank Post
    137
    Thanked 342 Times in 289 Posts
    Rep Power
    86
    Take a look at WPAD - Web Proxy Autodiscovery Protocol - Wikipedia, the free encyclopedia

    The basic idea is when your users connect to a network (be it inside or outside the school) the browser reaches out and looks for a wpad file - if it finds it the proxy settings from that file are used, if it doesn't find it then it makes a straight out connection to the internet (i.e. when at home).

    Easy enough to setup so long as you can spin up an internal web server and have control over your DHCP/DNS and best of all - totally transparent to your users!

  4. Thanks to jamesfed from:

    speckytecky (5th March 2014)

  5. #4


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,901
    Thank Post
    226
    Thanked 2,676 Times in 1,973 Posts
    Rep Power
    787
    Quote Originally Posted by itgeek View Post
    What would the best method to do this.
    James is right. WPAD is definitely the way to go.

  6. #5
    free780's Avatar
    Join Date
    Sep 2012
    Posts
    979
    Thank Post
    42
    Thanked 82 Times in 78 Posts
    Rep Power
    21
    Wpad is quite insecure. You have to hav a dns entry called wpad. A malicious hosts file could point the laptop to another proxy.

  7. #6

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,763
    Thank Post
    3,273
    Thanked 1,053 Times in 974 Posts
    Rep Power
    365
    Does WPad use a pac file or could you not create a pac file to suit and use gpo or gpp to assign the pac file path to IE ??

  8. #7


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,901
    Thank Post
    226
    Thanked 2,676 Times in 1,973 Posts
    Rep Power
    787
    Quote Originally Posted by free780 View Post
    A malicious hosts file could point the laptop to another proxy.
    Hosts file - as in C:\Windows\System32\drivers\etc\hosts?

    Standard users wouldn't be able to make any changes to that.

  9. #8

    Join Date
    Apr 2013
    Location
    Cornwall
    Posts
    30
    Thank Post
    0
    Thanked 11 Times in 11 Posts
    Rep Power
    4
    We have wpad set up here and it works flawlessly for staff and students. It uses the Proxy.pac file hosted on our smoothwall server but have had a version hosted on a web server pointing to an external proxy when we experiencing internet issues.

  10. Thanks to smidsy from:

    mac_shinobi (5th March 2014)

  11. #9
    free780's Avatar
    Join Date
    Sep 2012
    Posts
    979
    Thank Post
    42
    Thanked 82 Times in 78 Posts
    Rep Power
    21
    Ive seen cases of malware being able to write to the windows folders. Even through a standard user account.

  12. #10


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,901
    Thank Post
    226
    Thanked 2,676 Times in 1,973 Posts
    Rep Power
    787
    Quote Originally Posted by free780 View Post
    I've seen cases of malware being able to write to the windows folders. Even through a standard user account.
    If the computer is infected with malware, then the hosts file is the least of your problems. The malware could do literally anything!

  13. #11
    bslater's Avatar
    Join Date
    Oct 2012
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi I use a simple VBScript in the startup folder. Asks the user if they are in school, if so loads proxy settings, otherwise removes proxy settings.
    Paste into notepad, alter 000.000.000.000:8080 to your Proxy settings and port, save as .vbs
    It's almost teacher proof.

    Option Explicit
    Dim valUserIn
    Dim objShell, RegLocate, RegLocate1
    Set objShell = WScript.CreateObject("WScript.Shell")
    On Error Resume Next
    valUserIn = MsgBox("Use the SCHOOL settings?",4,"Cloaked Select")
    If valUserIn=vbYes Then
    RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\Curr entVersion\Internet Settings\ProxyServer"
    objShell.RegWrite RegLocate,"http://000.000.000.000:8080","REG_SZ"
    RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\Curr entVersion\Internet Settings\ProxyEnable"
    objShell.RegWrite RegLocate,"1","REG_DWORD"
    MsgBox "SCHOOL setting is Enabled"
    else
    RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\Curr entVersion\Internet Settings\ProxyServer"
    objShell.RegWrite RegLocate,"0.0.0.0:80","REG_SZ"
    RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\Curr entVersion\Internet Settings\ProxyEnable"
    objShell.RegWrite RegLocate,"0","REG_DWORD"
    MsgBox "HOME setting is Enabled"
    End If
    WScript.Quit

  14. #12

    LeMarchand's Avatar
    Join Date
    Jan 2008
    Location
    The deepest pits of hell
    Posts
    2,178
    Thank Post
    303
    Thanked 332 Times in 236 Posts
    Rep Power
    141
    I looked at WPAD but never got it working. Cheated by writing a .pac file and copying it to a local directory with a startup script and set the appropriate GPO to point IE at it. The .pac file enumerated various sites to bypass the proxy and then checked the machine's IP address/range and only applied the proxy if the machine was at school - so no user intervention required.

  15. #13

    Join Date
    Feb 2012
    Location
    West Midlands
    Posts
    45
    Thank Post
    0
    Thanked 6 Times in 6 Posts
    Rep Power
    7
    I used proxyswitcher lite, then its just a right click in the system tray - but a WPAD kinda setup is better. Or transparent gateway even better!
    Chris

  16. #14

    localzuk's Avatar
    Join Date
    Dec 2006
    Location
    Minehead
    Posts
    17,684
    Thank Post
    516
    Thanked 2,453 Times in 1,899 Posts
    Blog Entries
    24
    Rep Power
    833
    Quote Originally Posted by free780 View Post
    Wpad is quite insecure. You have to hav a dns entry called wpad. A malicious hosts file could point the laptop to another proxy.
    No you don't. You can define your WPAD location via a DHCP entry (Option 252). Then it can be at any IP address and path that you want. Ours is hosted by our Ruckus wireless controller, for example.

  17. #15

    sparkeh's Avatar
    Join Date
    May 2007
    Posts
    6,752
    Thank Post
    1,278
    Thanked 1,651 Times in 1,106 Posts
    Blog Entries
    22
    Rep Power
    506

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Setting Proxy Server policy Windows 2000
    By laserblazer in forum Windows
    Replies: 6
    Last Post: 18th March 2009, 12:11 PM
  2. Script to change printer server
    By button_ripple in forum Scripts
    Replies: 1
    Last Post: 16th September 2008, 12:29 PM
  3. Replies: 0
    Last Post: 22nd February 2008, 11:26 AM
  4. how to set proxy for explorer.exe
    By randomconept in forum General Chat
    Replies: 8
    Last Post: 22nd October 2007, 11:23 AM
  5. Script to set active directory object security
    By meastaugh1 in forum Windows
    Replies: 4
    Last Post: 5th January 2007, 04:28 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •