Solved

Check for corporate vpn T1 connection

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

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

Suggested Solutions

Title # Comments Views Activity
Getting rid of #VALUE! 7 23
save excel in the same active file's folder. 8 24
remove extra space at end of cell 12 34
Index Match Array? 5 39
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

828 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