Set-VpnConnection

Set-VpnConnection

Changes the configuration settings of an existing VPN connection profile.

Sintaxe

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>]

Descrição detalhada

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.

Aliases

nenhuma

Necessário?

false

Posição?

8

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-AsJob

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-AuthenticationMethod<String[]>

Specifies the authentication method to use for the VPN connection. Os valores aceitáveis para este parâmetro são: PAP, CHAP, MSCHAPv2, or EAP.

Aliases

nenhuma

Necessário?

false

Posição?

6

Valor padrão

MSChapv2

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-CimSession<CimSession[]>

Executa o cmdlet em uma sessão remota ou em um computador remoto. Insira um nome do computador ou um objeto de sessão, como a saída de um cmdlet New-CimSession ou Get-CimSession. O padrão é a sessão atual do computador local.

Aliases

Session

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-CustomConfiguration<XmlDocument>

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

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-DnsSuffix<String>

Specifies the DNS suffix of the VPN connection.

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-EapConfigXmlStream<XmlDocument>

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

Aliases

nenhuma

Necessário?

false

Posição?

12

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-EncryptionLevel<String>

Specifies the encryption level for the VPN connection. Os valores aceitáveis para este parâmetro são: NoEncryption, Optional, Required and Maximum.

Aliases

nenhuma

Necessário?

false

Posição?

5

Valor padrão

Required

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-Force

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

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-IdleDisconnectSeconds<UInt32>

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

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

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.

Aliases

nenhuma

Necessário?

false

Posição?

9

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-MachineCertificateEKUFilter<String[]>

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

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-MachineCertificateIssuerFilter<X509Certificate2>

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

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-Name<String>

Specifies the name of the VPN connection profile.

Aliases

ConnectionName

Necessário?

true

Posição?

2

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-PassThru

Retorna um objeto que representa o item com o qual você está trabalhando. Por padrão, este cmdlet não gera saída.

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-PlugInApplicationID<String>

Specifies the identifier for a third party application.

Aliases

nenhuma

Necessário?

false

Posição?

11

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-RememberCredential<Boolean>

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

Aliases

nenhuma

Necessário?

false

Posição?

10

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

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.

Aliases

ServerName,DefaultServer

Necessário?

false

Posição?

3

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-ServerList<CimInstance[]>

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

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

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.

Aliases

nenhuma

Necessário?

false

Posição?

7

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-ThirdPartyVpn

Indicates that the cmdlet runs for a third party profile.

Aliases

nenhuma

Necessário?

true

Posição?

4

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-ThrottleLimit<Int32>

Especifica o número máximo de operações simultâneas que podem ser estabelecidas para executar o cmdlet. Se esse parâmetro for omitido ou um valor de 0 for inserido, o Windows PowerShell® calculará o limite ideal de restrição para o cmdlet com base no número de cmdlets do CIM que estão em execução no computador. O limite de restrição se aplica somente ao cmdlet atual, e não à sessão ou ao computador.

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-TunnelType<String>

Specifies the type of tunnel used for the VPN connection. Os valores aceitáveis para este parâmetro são: PPTP, L2TP, SSTP, IKEv2, or Automatic.

Aliases

nenhuma

Necessário?

false

Posição?

4

Valor padrão

Automatic

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

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.

Aliases

nenhuma

Necessário?

false

Posição?

11

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-Confirm

Solicita que você confirme antes de executar o cmdlet.

Necessário?

false

Posição?

named

Valor padrão

false

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-WhatIf

Mostra o que aconteceria se o cmdlet fosse executado. O cmdlet não é executado.

Necessário?

false

Posição?

named

Valor padrão

false

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

<CommonParameters>

Esse cmdlet dá suporte a parâmetros comuns: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer e -OutVariable. Para obter mais informações, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entradas

O tipo de entrada é o tipo dos objetos que você pode canalizar para o cmdlet.

Saídas

O tipo de saída é o tipo de objeto emitido pelo cmdlet.

  • Microsoft.Management.Infrastructure.CimInstance#VpnConnection

    O objeto Microsoft.Management.Infrastructure.CimInstance é uma classe wrapper que exibe objetos da WMI (Instrumentação de Gerenciamento do Windows). O caminho após o sinal de cerquilha (#) indica o namespace e o nome de classe do objeto subjacente da WMI.
    The VpnConnection object contains the VpnConnection configuration settings.

Exemplos

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

Tópicos relacionados

Add-VpnConnection

Get-VpnConnection

Remove-VpnConnection