Link to home
Start Free TrialLog in
Avatar of vmich
vmichFlag for United States of America

asked on

Way to have users get proxy settings in office and have them removed when out of the office and then they get them again when they come back in.

We are running 2008 R2
I need to setup a way so that users when they are in the office get the proxy settings so they can get to the internet but when they are out of the office, the proxy settings are removed.
I have it setup now with GPO but cant seem to get it to remove the settings when the users logout and leave the office. It stays enabled and then they cant get to the internet until they come back into the office.
If any knows the best way to set this up, we really need to get this going?
Some have said to setup WPAD I think, but not sure and don't know anything about it.
Any help would be greatly appreciated.
Avatar of Arjun Vyavahare
Arjun Vyavahare
Flag of India image

Hi,

Maybe a script to do an IPConfig, and use the 'find' command to see if 192.168.1.X exists, and if not, set the following command?

reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyEnable" /t reg_dword /d "0x0" /f

Try this script -

@echo off

REM x.x.x should be the first 3 octects, or whatever would be static in your environment....
echo Detecting network....
echo.
ipconfig | find /i "x.x.x" && goto LAN

echo Disabling Proxy
echo.
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyEnable" /t reg_dword /d "0x0" /f && echo Proxy Disabled
echo.
pause
goto end

:lan
echo System is on the network, with the Proxy enabled
echo.
pause

:end
exit

Open in new window


Cheers,
Aj
ASKER CERTIFIED SOLUTION
Avatar of Sunil
Sunil
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vmich

ASKER

Sunil,
Thanks for the wpad link we are going to try to set this up now.
Avatar of vmich

ASKER

setup WPAD