?
Solved

Check for corporate vpn T1 connection

Posted on 2014-01-10
2
Medium Priority
?
199 Views
Last Modified: 2014-01-12
Previous question:
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_28311637.html


this simply tells me if i have a connection or not..

If I'm remote we use cisco Vpn to tunnel to our corporate netwrok.
So my solution for the previous question is workin fine:

Dim IsVPNConnected, sComputer, oWMIService, colItems, objItem
   
   
   IsVPNConnected = False
   sComputer = "."

   Set oWMIService = GetObject("winmgmts:\\" _
    & sComputer & "\root\CIMV2")

    
   Set colItems = oWMIService.ExecQuery( _
    "SELECT * FROM Win32_NetworkAdapterConfiguration", , 48)

    
   For Each objItem In colItems

'Please check description of your VPN Connection by running command "ipconfig /all" on command-line.

    If (InStr(objItem.Description, "AnyConnect")) Then
     IsVPNConnected = objItem.IPEnabled
    End If

   Next
   

   If (IsVPNConnected) Then
    IsVPNConnected = MsgBox("I am Connected to VPN.")
   Else
    IsVPNConnected = MsgBox("I am Not Connected to VPN.")
   End If

Open in new window


What I need:  If at my corporate office and NOT remote. The connection is live either wireless or Hard wired..

So is the code different to check to see if i'm on coporate vpn automatically ?


Thanks
fordraiders
0
Comment
Question by:fordraiders
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
MacroShadow earned 2000 total points
ID: 39773530
'Please check description of your VPN Connection by running command "ipconfig /all" on command-line.

Copy that description to line 19, i.e.     If (InStr(objItem.Description, "YourDescription")) Then
0
 
LVL 3

Author Closing Comment

by:fordraiders
ID: 39775743
Thanks, simple enough
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question