Share via


VpnConnection class

The VpnConnection class represents the profile of a virtual private network (VPN) connection.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties.

Syntax

[ClassVersion("1.0.0"), dynamic, provider("VpnClientPSProvider"), AMENDMENT]
class VpnConnection : VpnCommonConfig
{
  string                          ServerAddress;
  string                          ProvisioningAuthority;
  boolean                         RememberCredential;
  boolean                         SplitTunneling;
  boolean                         IsAutoTriggerEnabled;
  string                          Name;
  string                          ProfileType;
  string                          Guid;
  string                          ConnectionStatus;
  uint32                          IdleDisconnectSeconds;
  string                          ServerList[];
  string                          Routes[];
  string                          VpnTrigger;
  string                          DnsSuffix;
  string                          Proxy;
  boolean                         AllUserConnection;
  string                          AuthenticationMethod[];
  string                          EapConfigXmlStream;
  string                          EncryptionLevel;
  VpnConnectionIPsecConfiguration IPSecCustomPolicy[];
  string                          L2tpIPsecAuth;
  string                          MachineCertificateEKUFilter[];
  uint8                           MachineCertificateIssuerFilter[];
  string                          NapState;
  string                          TunnelType;
  boolean                         UseWinlogonCredential;
  string                          VpnConfigurationXml;
};

Members

The VpnConnection class has these types of members:

Properties

The VpnConnection class has these properties.

AllUserConnection

Data type: boolean

Access type: Read/write

True if the VPN connection profile is for all users; false if it is for a single user.

AuthenticationMethod

Data type: string array

Access type: Read/write

The authentication protocols to use for the VPN connection.

Chap ("Chap")

Challenge Handshake Authentication Protocol (CHAP).

Eap ("Eap")

Extensible Authentication Protocol (EAP).

MachineCertificate ("MachineCertificate")

A machine certificate.

MsChapv2 ("MsChapv2")

Microsoft Challenge Handshake Authentication Protocol version 2 (MSCHAPv2).

Pap ("Pap")

Password Authentication Protocol (PAP).

ConnectionStatus

Data type: string

Access type: Read-only

The connection status of the VPN connection.

This property is inherited from VpnCommonConfig.

Connected ("Connected")

Connected.

Connecting ("Connecting")

In the process of connecting.

Dormant ("Dormant")

The connection is dormant.

Limited ("Limited")

There connection has less than full capabilities.

NotConnected ("NotConnected")

Not connected.

DnsSuffix

Data type: string

Access type: Read/write

The DNS suffix of the connection.

This property is inherited from VpnCommonConfig.

EapConfigXmlStream

Data type: string

Access type: Read/write

The XML stream that contains the detailed EAP configuration for the VPN profile.

EncryptionLevel

Data type: string

Access type: Read/write

The encryption level for the VPN connection.

Maximum ("Maximum")

Maximum encryption.

NoEncryption ("NoEncryption")

No encryption.

Optional ("Optional")

Optional encryption.

Required ("Required")

Required encryption.

Guid

Data type: string

Access type: Read-only

The GUID of this VPN profile.

This property is inherited from VpnCommonConfig.

IdleDisconnectSeconds

Data type: uint32

Access type: Read/write

The amount of idle time after which a connection is terminated. A value of 0 disables the time-out.

This property is inherited from VpnCommonConfig.

IPSecCustomPolicy

Data type: VpnConnectionIPsecConfiguration array

Access type: Read/write

Qualifiers: EmbeddedInstance ("VpnConnectionIPsecConfiguration")

The IPSec custom policy.

IsAutoTriggerEnabled

Data type: boolean

Access type: Read-only

true if the VPN connection is enabled for auto-trigger; false if it is not.

This property is inherited from VpnCommonConfig.

Windows 8 and Windows Server 2012: The property is not available before Windows 8.1 and Windows Server 2012 R2.

L2tpIPsecAuth

Data type: string

Access type: Read-only

The authentication method of Layer Two Tunneling Protocol (L2TP) Internet Protocol security (IPSec).

Certificate ("Certificate")

Machine certificate.

Psk ("Psk")

Preshared key.

MachineCertificateEKUFilter

Data type: string array

Access type: Read/write

A filter based on Certificate EKU Name or OID to select the Machine Certificate for authentication. This property applies when IKEv2 tunnel type along with Machine Certificate authentication method is used.

MachineCertificateIssuerFilter

Data type: uint8 array

Access type: Read/write

A filter based on the root certificate issuer to select the Machine Certificate for authentication. This property applies when IKEv2 tunnel type along with Machine Certificate authentication method is used.

Name

Data type: string

Access type: Read/write

The name of the current VPN connection profile.

This property is inherited from VpnCommonConfig.

NapState

Data type: string

Access type: Read-only

The Network Access Protection (NAP) health status of the connection. This property applies when the Protected Extensible Authentication Protocol (PEAP) authentication protocol is used.

Error ("Error")

An error occurred.

NoConnection ("NoConnection")

No connection has been made.

NotNapCapable ("NotNapCapable")

NAP is not supported.

Success ("Success")

The connection is successful.

ProfileType

Data type: string

Access type: Read/write

The profile type.

This property is inherited from VpnCommonConfig.

Inbox ("Inbox")

The profile is an inbox profile.

ThirdParty ("ThirdParty")

The profile is a third party profile.

ProvisioningAuthority

Data type: string

Access type: Read/write

The provisioning authority of the VPN profile.

This property is inherited from VpnCommonConfig.

Windows 8 and Windows Server 2012: The property is not available before Windows 8.1 and Windows Server 2012 R2.

Proxy

Data type: string

Access type: Read/write

Qualifiers: EmbeddedInstance ("VpnConnectionProxy")

The proxy settings of the VPN connection.

This property is inherited from VpnCommonConfig.

RememberCredential

Data type: boolean

Access type: Read/write

true to store the credentials used for the first successful connection; otherwise, false.

This property is inherited from VpnCommonConfig.

Routes

Data type: string array

Access type: Read/write

Qualifiers: EmbeddedInstance ("MSFT_NetRoute")

The list of routes to plumb on the VPN interface when the VPN profile is connected.

This property is inherited from VpnCommonConfig.

ServerAddress

Data type: string

Access type: Read/write

The address of the remote VPN server that the client connects to. This address is a URL, a friendly name, an IPv4 address, or an IPv6 address. This should be one of the elements of ServerList.

This property is inherited from VpnCommonConfig.

ServerList

Data type: string array

Access type: Read/write

Qualifiers: EmbeddedInstance ("VpnServerAddress")

The VPN server list.

This property is inherited from VpnCommonConfig.

SplitTunneling

Data type: boolean

Access type: Read/write

true to enable split tunneling; false to disable it.

This property is inherited from VpnCommonConfig.

TunnelType

Data type: string

Access type: Read/write

The tunnel type that is used in the RAS configuration. The tunnel type is decided after the first successful connection.

Automatic ("Automatic")

Automatic detection.

Ikev2 ("Ikev2")

Internet Key Exchange version 2 (IKEv2).

L2tp ("L2tp")

Layer 2 Tunneling Protocol.

Pptp ("Pptp")

Point to Point Tunneling Protocol (PPTP).

Sstp ("Sstp")

Secure Socket Tunneling Protocol (SSTP).

UseWinlogonCredential

Data type: boolean

Access type: Read/write

True if the Windows logon credentials for the user are automatically used for connections with the current VPN connection profile; otherwise, false.

This flag is only used for the MSCHAPv2 and EAP-MSCHAPv2 authentication methods.

VpnConfigurationXml

Data type: string

Access type: Read-only

An XML representation of this instance, which can be used as input for MSFT_VpnConnection::Set.

VpnTrigger

Data type: string

Access type: Read/write

Qualifiers: EmbeddedInstance ("VpnConnectionTrigger")

The trigger properties of the VPN connection.

This property is inherited from VpnCommonConfig.

Requirements

Minimum supported client
Windows 8
Minimum supported server
Windows Server 2012
Namespace
Root\Microsoft\Windows\RemoteAccess\Client
MOF
VPNClientPSProvider.mof
DLL
VPNClientPSProvider.dll

See also

VpnCommonConfig

MSFT_VpnConnection

PS_VpnConnection