Get windows VPN adapters with -AllUserConnections parameter

  • Thread starter Thread starter Johny V
  • Start date Start date
J

Johny V

Guest
I need to get all VPN adapters programatically with C#

It works with rasphone.pbk

Like in this answer: Get Windows VPN Interfaces in C#

Problem i found is when you create VPN from powershell with -AllUserConnections (all users can use vpn form login screen). It's not saved in that rasphone.pbk
The connection is saved somewhere in global phonebook due to msdocs. I was trying but was not able to find it.

PS command i use to add VPN:

Add-VpnConnection -Name " + VPNName + " -ServerAddres " + serveraddress + " -TunnelType L2tp -L2tpPsk " + L2tpPSK + " -Force -AuthenticationMethod MSChapv2 -EncryptionLevel Optional -AllUserConnection

Any idea where could it be? Or any idea how to check for VPN adapters with this parameter? Maybe with WMI but could not find adapter there either.

Continue reading...
 
Back
Top