Friday, July 30, 2010
 
  Forum  Royal TS  Toolbox  Automated SonicWALL Global VPN Client connect
Previous Previous
 
Next Next
New Post 2/14/2010 11:33 AM
User is offline jisageie
1 posts
No Ranking


Automated SonicWALL Global VPN Client connect 

When trying to establish a connection using the SonicWALL command line interface, I discovered that it returned long before the connection was established, leaving Royal TS waiting forever.

The script below solves the problem. In addition to passing the path to the SonicWALL executable, name of the connection, username and password, I pass the network to look for (like 192.168.10). I am using ipconfig to decide if the connection is up or not since an ip address in that net should appear in the result when a connection is established.

Royal TS Task Details: 
Command : <location>\SONICWALL_CONNECT.bat
Arguments: "C:\Program Files\SonicWALL\SonicWALL Global VPN Client\SWGVC.exe" "<name>" "<user>" "<pwd>" "<net>"

SONICWALL_CONNECT.bat:

@echo OFF
rem ---- start SonicWALL "Enable"
%1 /E %2 /U %3 /P %4
rem ---- init loop counter
set /a cnt=0
rem ---- start loop
:again
rem ---- check for assigned ip address in the specified net
ipconfig | FIND /c %5 >NUL
rem ---- errorlevel 0 means found, exit 0
if %errorlevel% equ 0 exit 0
set /a cnt+=1
rem ---- use ping on a non existing address to pause
ping 1.1.1.1 -n 1 -w 250 >NUL
rem ---- loop up to 40 times (10 seconds)
if %cnt% lss 40 goto again
rem ---- no success exit 1
exit 1
 

 
New Post 3/2/2010 4:20 PM
User is offline StefanKoell
541 posts
www.code4ward.net
6th Level Poster


Re: Automated SonicWALL Global VPN Client connect 

Thanks for sharing your solution. I'm constantly amazed what one can do with pure batch files!

cheers,
Stefan


Join Royal TS on Facebook
 
Previous Previous
 
Next Next
  Forum  Royal TS  Toolbox  Automated SonicWALL Global VPN Client connect

 

Privacy Statement  |  Terms Of Use
Copyright 2010 by code4ward - Stefan Koell
Cloud Server hosted by | Web Design