Set-VpnConnection

Set-VpnConnection

Changes the configuration settings of an existing VPN connection profile.

構文

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

詳細説明

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.

パラメーター

-AllUserConnection

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

エイリアス

なし

必須?

false

位置は?

8

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-AsJob

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-AuthenticationMethod<String[]>

Specifies the authentication method to use for the VPN connection. このパラメーターに対して使用できる値: PAP, CHAP, MSCHAPv2, or EAP.

エイリアス

なし

必須?

false

位置は?

6

既定値

MSChapv2

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-CimSession<CimSession[]>

リモート セッションまたはリモート コンピューターでコマンドレットを実行します。New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など、コンピューター名またはセッション オブジェクトを入力します。既定値は、ローカル コンピューターで実行中の現在のセッションです。

エイリアス

Session

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-CustomConfiguration<XmlDocument>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-DnsSuffix<String>

Specifies the DNS suffix of the VPN connection.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-EapConfigXmlStream<XmlDocument>

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

エイリアス

なし

必須?

false

位置は?

12

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-EncryptionLevel<String>

Specifies the encryption level for the VPN connection. このパラメーターに対して使用できる値: NoEncryption, Optional, Required and Maximum.

エイリアス

なし

必須?

false

位置は?

5

既定値

Required

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Force

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-IdleDisconnectSeconds<UInt32>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

9

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-MachineCertificateEKUFilter<String[]>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-MachineCertificateIssuerFilter<X509Certificate2>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Name<String>

Specifies the name of the VPN connection profile.

エイリアス

ConnectionName

必須?

true

位置は?

2

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-PassThru

作業中の項目を表すオブジェクトを返します。既定では、このコマンドレットによる出力はありません。

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-PlugInApplicationID<String>

Specifies the identifier for a third party application.

エイリアス

なし

必須?

false

位置は?

11

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-RememberCredential<Boolean>

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

エイリアス

なし

必須?

false

位置は?

10

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

ServerName,DefaultServer

必須?

false

位置は?

3

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-ServerList<CimInstance[]>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

7

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-ThirdPartyVpn

Indicates that the cmdlet runs for a third party profile.

エイリアス

なし

必須?

true

位置は?

4

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ThrottleLimit<Int32>

このコマンドレットを実行するために確立できる最大同時操作数を指定します。このパラメーターを省略するか、値として 0 を入力した場合、Windows PowerShell® では、コンピューターで実行している CIM コマンドレットの数に基づいて、コマンドレットに対する最適なスロットル制限を計算します。スロットル制限は現在のコマンドレットのみに適用され、セッションまたはコンピューターには適用されません。

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-TunnelType<String>

Specifies the type of tunnel used for the VPN connection. このパラメーターに対して使用できる値: PPTP, L2TP, SSTP, IKEv2, or Automatic.

エイリアス

なし

必須?

false

位置は?

4

既定値

Automatic

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

11

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • Microsoft.Management.Infrastructure.CimInstance#VpnConnection

    Microsoft.Management.Infrastructure.CimInstance オブジェクトは、Windows Management Instrumentation (WMI) オブジェクトを表示するラッパー クラスです。シャープ記号 (#) の後のパスは、基になる WMI オブジェクトの名前空間とクラス名です。
    The VpnConnection object contains the VpnConnection configuration settings.

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

関連トピック

Add-VpnConnection

Get-VpnConnection

Remove-VpnConnection