Set-VpnConnection

Set-VpnConnection

Changes the configuration settings of an existing VPN connection profile.

Sintaxis

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

Parameter Set: ThirdParty
Set-VpnConnection [-Name] <String> [[-ServerAddress] <String> ] [-ThirdPartyVpn] [[-SplitTunneling] <Boolean> ] [[-RememberCredential] <Boolean> ] [[-PlugInApplicationID] <String> ] [-AsJob] [-CimSession <CimSession[]> ] [-CustomConfiguration <XmlDocument> ] [-DnsSuffix <String> ] [-Force] [-IdleDisconnectSeconds <UInt32> ] [-PassThru] [-ServerList <CimInstance[]> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Descripción detallada

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.

Parámetros

-AllUserConnection

Indicates that the VPN connection specified is in the global phone book.

Alias

ninguno

¿Requerido?

false

¿Posición?

8

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-AsJob

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-AuthenticationMethod<String[]>

Specifies the authentication method to use for the VPN connection. Los valores aceptables para este parámetro son los siguientes: PAP, CHAP, MSCHAPv2, or EAP.

Alias

ninguno

¿Requerido?

false

¿Posición?

6

Valor predeterminado

MSChapv2

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-CimSession<CimSession[]>

Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.

Alias

Session

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-CustomConfiguration<XmlDocument>

Specifies an XML document that allows vendors to specify custom configuration information.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-DnsSuffix<String>

Specifies the DNS suffix of the VPN connection.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-EapConfigXmlStream<XmlDocument>

Specifies the contents of the EAP XML configuration file, which includes the EAP method ID.

Alias

ninguno

¿Requerido?

false

¿Posición?

12

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-EncryptionLevel<String>

Specifies the encryption level for the VPN connection. Los valores aceptables para este parámetro son los siguientes: NoEncryption, Optional, Required and Maximum.

Alias

ninguno

¿Requerido?

false

¿Posición?

5

Valor predeterminado

Required

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Force

Indicates that the pre-shared key (PSK) value is supplied over an insecure channel, if L2TP is used.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-IdleDisconnectSeconds<UInt32>

Specifies the time, in seconds, before closing an idle connection.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-L2tpPsk<String>

Specifies the value of the PSK to be used for L2TP authentication. If this parameter is not specified, a certificate is used for L2TP.

Alias

ninguno

¿Requerido?

false

¿Posición?

9

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-MachineCertificateEKUFilter<String[]>

Specifies an array of enhanced key usage (EKU) filters for Internet Key Exchange version 2 (IKEv2) machine certificate selection.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-MachineCertificateIssuerFilter<X509Certificate2>

Specifies the X509 certificate of the issuer filter for IKEv2 machine certificate selection.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Name<String>

Specifies the name of the VPN connection profile.

Alias

ConnectionName

¿Requerido?

true

¿Posición?

2

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-PassThru

Devuelve un objeto que representa el elemento con el que está trabajando. De forma predeterminada, este cmdlet no genera ningún resultado.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-PlugInApplicationID<String>

Specifies the identifier for a third party application.

Alias

ninguno

¿Requerido?

false

¿Posición?

11

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-RememberCredential<Boolean>

Indicates that the credentials supplied at the time of first successful connection is stored in the cache, if set to $True.

Alias

ninguno

¿Requerido?

false

¿Posición?

10

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ServerAddress<String>

Specifies the address of the remote VPN server to which the client connects. You can specify the address as a fully qualified domain name (FQDN), an IPv4 address, or an IPv6 address.

Alias

ServerName,DefaultServer

¿Requerido?

false

¿Posición?

3

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ServerList<CimInstance[]>

Specifies an array of VPN servers. The VPN client can connect to these servers.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-SplitTunneling<Boolean>

Indicates whether the cmdlet enables split tunneling for the VPN connection profile. When you enable split tunneling, traffic to destinations outside the intranet does not flow through the VPN tunnel. Specify a value of $True to enable split tunneling.

Alias

ninguno

¿Requerido?

false

¿Posición?

7

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ThirdPartyVpn

Indicates that the cmdlet runs for a third party profile.

Alias

ninguno

¿Requerido?

true

¿Posición?

4

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-ThrottleLimit<Int32>

Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-TunnelType<String>

Specifies the type of tunnel used for the VPN connection. Los valores aceptables para este parámetro son los siguientes: PPTP, L2TP, SSTP, IKEv2, or Automatic.

Alias

ninguno

¿Requerido?

false

¿Posición?

4

Valor predeterminado

Automatic

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-UseWinlogonCredential<Boolean>

Indicates whether to use Windows logon credentials. Specify a value of $True to use MSCHAPv2 or EAP-MSCHAPv2 as the authentication method and use Windows logon credentials automatically when connecting with the VPN connection profile.

Alias

ninguno

¿Requerido?

false

¿Posición?

11

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Confirm

Solicita confirmación antes de ejecutar el cmdlet.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-WhatIf

Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

<CommonParameters>

Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entradas

El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.

Salidas

El tipo de resultado es el tipo de objetos que emite el cmdlet.

  • Microsoft.Management.Infrastructure.CimInstance#VpnConnection

    El objeto Microsoft.Management.Infrastructure.CimInstance es una clase contenedora que muestra objetos de Instrumental de administración de Windows (WMI). La ruta de acceso después del signo de número (#) proporciona el espacio de nombres y el nombre de clase del objeto WMI subyacente.
    The VpnConnection object contains the VpnConnection configuration settings.

Ejemplos

Example 1: Configure a single VPN connection

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.

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

Example 2: Configure a VPN connection with several settings

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.

PS C:\> Set-VpnConnection -Name "Test3" -AllUserConnection -TunnelType L2tp -EncryptionLevel Optional -AuthenticationMethod Pap -SplitTunneling $False -RememberCredential $False -PassThru

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

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.

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

Temas relacionados

Add-VpnConnection

Get-VpnConnection

Remove-VpnConnection