PowerShell Logo Small

Set-VpnConnection



This is the built-in help made by Microsoft for the command 'Set-VpnConnection', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Changes the configuration settings of an existing VPN connection profile.

SYNTAX


Set-VpnConnection [[-RememberCredential] <Boolean>] [[-UseWinlogonCredential] <Boolean>] [[-EapConfigXmlStream] <XmlDocument>] [-Name] <String> [[-ServerAddress] <String>]
[[-TunnelType] <String>] [[-EncryptionLevel] <String>] [[-AuthenticationMethod] <String[]>] [[-SplitTunneling] <Boolean>] [[-AllUserConnection]] [[-L2tpPsk] <String>]
[-AsJob] [-CimSession <CimSession[]>] [-DnsSuffix <String>] [-Force] [-IdleDisconnectSeconds <UInt32>] [-MachineCertificateEKUFilter <String[]>]
[-MachineCertificateIssuerFilter <X509Certificate2>] [-PassThru] [-ServerList <CimInstance[]>] [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]
Set-VpnConnection [[-RememberCredential] <Boolean>] [[-PlugInApplicationID] <String>] [-Name] <String> [[-ServerAddress] <String>] [-ThirdPartyVpn] [[-SplitTunneling]
<Boolean>] [-AsJob] [-CimSession <CimSession[]>] [-CustomConfiguration <XmlDocument>] [-DnsSuffix <String>] [-Force] [-IdleDisconnectSeconds <UInt32>] [-PassThru]
[-ServerList <CimInstance[]>] [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Set-VpnConnection cmdlet changes the configuration settings of an existing VPN connection profile. If the VPN profile specified does not exist, you see an error. If
errors occur when you modify the VPN profile, the cmdlet returns the error information.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=290788
Add-VpnConnection
Get-VpnConnection
Remove-VpnConnection

REMARKS

<

Examples


Example 1: Configure a single VPN connection

PS C:\> Set-VpnConnection -Name "Test1" -ServerAddress "10.1.1.2" -PassThru
Name : Test1

ServerAddress : 10.1.1.2

AllUserConnection : False

Guid : {4B308E9B-C225-42CB-8158-307193429591}

TunnelType : Automatic

AuthenticationMethod : {MsChapv2}

EncryptionLevel : Required

L2tpIPsecAuth : Certificate

UseWinlogonCredential : False

EapConfigXmlStream :
ConnectionStatus : Disconnected

NapState : NotConnected

RememberCredential : False

SplitTunneling : False



This command configures the VPN connection named Test1 to connect to the server with an IP address of 10.1.1.2. By specifying the Passthru parameter, you can see the
configuration of the VPN connection object.




Example 2: Configure a VPN connection with several settings

PS C:\>Set-VpnConnection -Name "Test3" -AllUserConnection -TunnelType L2tp -EncryptionLevel Optional -AuthenticationMethod Pap -SplitTunneling $False -RememberCredential
$False -PassThru
WARNING: The currently selected encryption level requires EAP or MS-CHAPv2 logon security methods. Data encryption will not occur for Pap or Chap.
Name : Test3

ServerAddress : 10.1.1.1

AllUserConnection : True

Guid : {76746D4E-D72A-467D-A11F-3D4D9075F50D}

TunnelType : L2tp

AuthenticationMethod : {Pap}

EncryptionLevel : Optional

L2tpIPsecAuth : Certificate

UseWinlogonCredential : False

EapConfigXmlStream :

ConnectionStatus : Disconnected

NapState : NotConnected

RememberCredential : False

SplitTunneling : False



This command configures the VPN connection named Test3 and located in the global phone book as follows:

-- The connection is configured to use L2tp as the tunnel type, as specified by the TunnelType parameter
-- The tunnel is using optional encryption, as specified by the EncryptionLevel parameter
-- The authentication method used by the connection is PAP, as specified by the AuthenticationMethod parameter
-- Split tunneling is turned off, as specified by the SplitTunneling parameter, and the value of $False
-- Credential caching is turned off, as specified by the RememberCredential parameter and the value of $False

By specifying the Passthru parameter, you can see the configuration of the VPN connection object.




Example 3: Configure a VPN connection to use a custom EAP configuration

This command stores the result of the New-EapConfiguration cmdlet into the variable named $A.
PS C:\>$A = New-EapConfiguration -Tls

This command configures the VPN connection named Test4 in the global phone book to use the custom EAP configuration by:

-- Specifying the AuthenticationMethod parameter with the value EAP
-- Specifying the EapConfigXmlStream parameter with the value of the EapConfigXmlStream method of the previously created variable.By specifying the Passthru parameter, you
can see the configuration of the VPN connection object.
PS C:\>Set-VpnConnection -Name "Test4" -AllUserConnection -AuthenticationMethod Eap -EapConfigXmlStream $A.EapConfigXmlStream -PassThru
Name : Test4

ServerAddress : 10.1.1.1

AllUserConnection : True

Guid : {1D423FF3-E3D4-404A-B052-DB9130656D29}

TunnelType : L2tp

AuthenticationMethod : {Eap}

EncryptionLevel : Required

L2tpIPsecAuth : Psk

UseWinlogonCredential : False

EapConfigXmlStream : #document

ConnectionStatus : Disconnected

NapState : NotConnected

RememberCredential : True

SplitTunneling : True



This set of commands first creates a custom EAP configuration, and then configures a VPN connection from the global phone book to use the new custom EAP configuration.

For more information about custom EAP creation, see the New-EapConfiguration cmdlet.