VpnAdapter Property  
 

Return the name of the active VPN adapter.

Syntax

object.VpnAdapter

Remarks

The VpnAdapter property attempts to detect if the system is currently using a Virtual Private Network (VPN) connection. The detection logic is based on identifying active network adapters with names or descriptions that match known VPN software or common VPN adapter naming conventions, while explicitly excluding adapters associated with virtualization platforms (such as Hyper-V, VMware, and VirtualBox), loopback interfaces, and other non-VPN virtual adapters.

Because there is no industry standard for how VPN clients are identified at the network adapter level, this function uses a heuristic approach and cannot guarantee detection in every scenario. Some VPN clients may use custom adapter names or attempt to obscure their presence, and new VPN software may not be recognized until the internal detection list is updated. There is also a small chance that non-VPN software using similar naming conventions could result in a false positive.

The value of this property should be treated as a hint for diagnostic or troubleshooting purposes. It should not be used to restrict access to your application or deny service to users based solely on the possible presence of a VPN connection. If you wish to determine the IP address assigned to the VPN adapter, check the value of the VpnAddress property.

If no active VPN adapter is detected, this property will return an empty string.

Data Type

String

See Also

ExternalAddress Property, HostAddress Property, LocalAddress Property, VpnAddress Property