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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scriptability of Cisco VPN client? 1

Status
Not open for further replies.
Jul 3, 2007
1
Can one setup a batch file or script that will call the VPN client, execute the portion of a VB.NET app we have written, sync with a SQL Server database, and then close the app and client when done? We want to implement a one-click solution for our users to be able to synchronise data, and have deemed that Cisco VPN is the most secure and expedient way to do this. I just want to know that it's scriptable. I tried looking for API's on Cisco's site, but couldn't find anything pertinent.
 
I really know nothing about scripting, or exactly how a program executes, but the executable for the vpn client is called ipsecdialer.exe
Can't you just look at things like vpnclient.inin in C:\Program Files\Cisco Systems\VPN Client??? Or am I WAY out of my league?

Burt
 
To the first part of the question:
Yes, the Cisco client is scriptable. You can use the /? after either vpnclient.exe, vpngui.exe or ipsecdialer.exe.

I use the vpnclient.exe with a command line like:

vpnclient.exe connect <profile name> user ####### pwd ########

to make the connection. I have a preconfigured profile on the workstation specify the details for the connection.

I use: vpnclient.exe disconect to end the connection.

In my vbscript I execute the command line like this

Set objShell = CreateObject("WScript.Shell")
Set gobjCiscoShell = objShell.exec(strConnect)

where 'strConnect' is replaced with the full path name for vpnclient.exe with all the arguments listed. A front end gathers the user's name and password using an .hta.

I check to see if the connection has been established by looping through this check:

if CreateObject("WScript.Shell").RegRead(RegLocation) = 1 then 'connection established.

Where RegLocation is:
Const RegLocate = "HKEY_LOCAL_MACHINE\Software\Cisco Systems\VPN Client\TunnelEstablished"

The client places a '1' in the entry on connection and '0' when disconnected.

Hopes this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top