Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

Check for corporate vpn T1 connection

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
Fordraiders
Asked:
Fordraiders
1 Solution
 
MacroShadowCommented:
'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
 
FordraidersAuthor Commented:
Thanks, simple enough
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now