Solved

Check for corporate vpn T1 connection

Posted on 2014-01-10
2
156 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 26

Accepted Solution

by:
MacroShadow earned 500 total points
Comment Utility
'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
Comment Utility
Thanks, simple enough
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

772 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

10 Experts available now in Live!

Get 1:1 Help Now