Jump to content

Recommended Posts

Posted

On XP, we can get the IP address for an VPN connections like below:

strComputer = "." 
Set objWMIService = GetObject("winmgmts:" _  
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")  
 
Set IPConfigSet = objWMIService.ExecQuery _  
    ("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")  
   
For Each IPConfig in IPConfigSet  
    If Not IsNull(IPConfig.IPAddress) Then   
        For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)  
            WScript.Echo IPConfig.IPAddress(i)  
        Next  
    End If  
Next

But on Vista, the VPN connection is not in this Win32_NetworkAdapterConfiguration class, where it has gone??

One way ist netsh interface ip show address %PPTPname% but ist there a way via wmi ?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...