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

check status of Cisco VPN client in vbscript.

Status
Not open for further replies.

OrionCookies

Programmer
May 5, 2005
43
US
Is there any way to check connection status of Cisco VPN Client to see if it is connected or disconnected.
I am using XP SP2.
 
The VPN sets up a separate NIC entry. You can check the status of that. It's either Win32_Network or Win32_NetworkConnection that you query with WMI. If that is not enough to get you going, post back with more detail of where you are stuck.

Are you looking for a very specifically named VPN connection or multiples? Will this be set for a specific machine or will it need to work on multiple PCs?
 
Thanks for your reply wcburton ..
I am trying this. The reason i choose description because when i do ipconfig all ..under description it gave me "Cisco Systems VPN Adapter"......to find out if computer is connected through vpn or not...

Option Explicit

Dim objWMI
Dim colClass
Dim objClass

Dim strComputer

strComputer = "."
Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colClass = objWMI.ExecQuery("Select * from Win32_NetworkConnection",,48)


On Error Resume Next

For Each objClass in colClass
WScript.Echo "DisplayType: " & objClass.discription
Next

Set objWMI = Nothing
Set colClass = Nothing
Set objClass = Nothing


This script is not giving me any output...
When I connect computer through CISCO VPN connection, on system try, vpn icon says connected. is there any way to catch this sequence....
 
OK, I led you a little astray. I think NetworkConnection is attachement to network resources (servers or printers). Another tool I should point you to is Scriptomatic - download from Microsoft at this link:

Using that I found / remembered that this is what you are looking for:
Win32_NetworkAdapterConfiguration -- where IPenabled = 'True' can help limit the results
and Win32_NetworkAdapter

Also, now that I am thinking a little more clearly, what is your end goal? Sometimes you can achieve your result more easily down a different path. An alternate option that I have used is to try to ping a known address that is only reachable by the connection you want to check.

I have something else that I wrote regarding a CiscoVPN. When I locate that I will post that as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top