Announcement

Collapse
No announcement yet.

GPO/Script to Remove Proxy Upon Logoff or Shutdown

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • GPO/Script to Remove Proxy Upon Logoff or Shutdown

    Hi guys,

    Not sure if this is the correct room to post this message or anybody else have asked this question before.

    How to write a script to remove proxy settings upon user log off or shutdown from the laptop. Where can i find help in internet to get those scripting syntax?

    Thank y'all in advance.
    Mind is like a parachute, it only works when it's open!

  • #2
    Re: GPO/Script to Remove Proxy Upon Logoff or Shutdown

    Do you want a PAC file (a script that will decided what proxy server to use, depending on where you are (if your in a domain, you use its proxy server, but once you leave, it will try to find the normal standard proxy server)), or are you after something else?

    If you are after a PAC file, there are heaps of sites about making them, but none of them all that great. You will also need to look into wpad if you want it to be 100% DNS handled.
    http://www.aspfree.com/c/a/BrainDump...ng-a-Pac-File/
    http://en.wikipedia.org/wiki/Proxy_auto-config

    If this is not what you want.. then sorry, and can we have some more infomation.

    (If you just want a script that removes the tick box, you can do it via GPO or a log off script that runs a Reg file)

    Wofen

    Wofen
    Good to be back....

    Comment


    • #3
      Re: GPO/Script to Remove Proxy Upon Logoff or Shutdown

      Mine proxy environment i believe is very simple and straight forward.

      The GPO that deploys Internet Explorer proxy settings is configured at the OU level, so when the users belong to the OU logs in to the domain, the proxy settings automatically apply to their IE. What i need is that, when the user log off or shutdown and bring the laptop back to home, the proxy settings automatically deactivated or removed upon logging off or shutting down, so that my users can use IE to browse internet at home or on the road.
      Mind is like a parachute, it only works when it's open!

      Comment


      • #4
        Re: GPO/Script to Remove Proxy Upon Logoff or Shutdown

        I believe you can use the GPO loopback to remove it when they log off, but I do not know enough to talk about it.

        I can say that you can achive what you want using PAC and WPAD.

        The PAC is basiclly a script file that gets your IP/domain, then runs though a If/then statment with If the Computer is here, use this, and gives it its Proxy server.

        Wpad is for the auto discovery of the PAC file via DNS, when the computer contacts the DNS server for its DNS, it is also told where to look for the PAC file (normally Wpad.Server.com or something like that).

        Its alot simpler then I explanded it, and once it works its great. I would recommend looking into using the Pac/Wpad methiod.

        Wofen
        Good to be back....

        Comment


        • #5
          Re: GPO/Script to Remove Proxy Upon Logoff or Shutdown

          Similar thread found in scripting forum: "Turn off proxy via shutdown script?"

          This posting is provided "AS IS" with no warranties, and confers no rights.

          __________________

          ** Remember to give credit where credit's due **
          and leave Reputation Points for meaningful posts

          Comment


          • #6
            Re: GPO/Script to Remove Proxy Upon Logoff or Shutdown
            This is a shutdown script you can try if you need it m8, works great for me using a GPOs : (disableproxy.vbs)

            Code:

            strComputer = "."
            Const HKEY_CURRENT_USER = &H80000001


            Set objReg = GetObject("winmgmts:{impersonationLevel=impersonat e}!\\" & _
            strComputer & "\root\default:StdRegProv")

            strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Interne t Settings"
            strEntryName = "ProxyEnable"
            dwValue = 0
            objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strEntryName, dwValue

            Err.Clear

            If you need a startup script to enable it again, use the same code but change the dwValue to 1
            Do i need to change the strEntryName to ProxyDisable?
            Mind is like a parachute, it only works when it's open!

            Comment


            • #7
              Re: GPO/Script to Remove Proxy Upon Logoff or Shutdown

              Disable:
              strEntryName = "ProxyEnable"
              dwValue = 0


              Enable:
              strEntryName = "ProxyEnable"
              dwValue = 1

              This posting is provided "AS IS" with no warranties, and confers no rights.

              __________________

              ** Remember to give credit where credit's due **
              and leave Reputation Points for meaningful posts

              Comment

              Working...
              X