Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon Script Question 1

Status
Not open for further replies.

Yardyy

Technical User
Joined
Aug 13, 2002
Messages
448
Location
GB
Does anyone know how i go about detecting how a user has come onto the network, I distribute the anti virus updates via the login script, and i dont want some poor old person waiting half an hour for the script to finish before they can do any work, they are coming on dial up..

I want to be able to detect if they are coming in from the VPN then dont use the normal script but use this other that i can setup without the anti virus update.

Thanks in advance.. Regards

Yardyy
 
The way we do it is through the users IP address. We use 10.x.x.x internally so I just check to see if their ip starts with "IP10."

NOTE** When the first line of code saves the IP address to a variable, I add "IP" in front because if you search for just "10." that could appear in on of the other octets of the IP address.

******************Code Follows**************8

rem The following line of code gets the ip address and puts it into a variable
rem called IPADDR. This was taken from a file called GETIP.CMD written by
rem Rob van der Woude (
FOR /F "TOKENS=2* DELIMS=:" %%A IN ('IPCONFIG /ALL ^| FIND "IP Address"') DO FOR %%B IN (%%A) DO SET IPADDR=IP%%B

echo.Checking Dial-Up User . . .
echo.%ipaddr% | find "IP10." /i
if "%errorlevel%"=="0" goto IsInternal

....Do stuff for VPN User....

goto end
:IsInternal

....Do stuff for LAN User....

:end
 
Thanks for that, most helpful, and fast.. Regards

Yardyy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top