Solved

Check for corporate vpn T1 connection

Posted on 2014-01-10
2
172 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
2 Comments
 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Tags from access to excel 3 31
Excel Score Formula 5 51
Excel 17 16
Excel 2016 loop through 6 0
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
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…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

862 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now