Add-VpnConnection

Add-VpnConnection

Adds a VPN connection to the Connection Manager phone book.

구문

Parameter Set: InboxProfile
Add-VpnConnection [-Name] <String> [-ServerAddress] <String> [[-TunnelType] <String> ] [[-EncryptionLevel] <String> ] [[-AuthenticationMethod] <String[]> ] [[-SplitTunneling]] [[-AllUserConnection]] [[-L2tpPsk] <String> ] [[-RememberCredential]] [[-UseWinlogonCredential]] [[-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
Add-VpnConnection [-Name] <String> [-ServerAddress] <String> [[-SplitTunneling]] [[-RememberCredential]] [-PlugInApplicationID] <String> -CustomConfiguration <XmlDocument> [-AsJob] [-CimSession <CimSession[]> ] [-DnsSuffix <String> ] [-Force] [-IdleDisconnectSeconds <UInt32> ] [-PassThru] [-ServerList <CimInstance[]> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

자세한 설명

The Add-VpnConnection cmdlet adds a VPN connection with the specified parameters to the Connection Manager phone book. If errors occur when you create the VPN profile, the cmdlet returns the error information.

매개 변수

-AllUserConnection

Indicates that the cmldet adds the VPN connection to the global phone book entries.

별칭

없음

필수 여부

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

원격 세션에서 또는 원격 컴퓨터에서 cmdlet을 실행합니다. New-CimSession 또는 Get-CimSession cmdlet의 출력과 같은 컴퓨터 이름이나 세션 개체를 입력합니다. 기본값은 로컬 컴퓨터의 현재 세션입니다.

별칭

Session

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-CustomConfiguration<XmlDocument>

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

별칭

없음

필수 여부

true

위치

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 an idle connection is closed.

별칭

없음

필수 여부

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 this VPN connection profile.

별칭

ConnectionName

필수 여부

true

위치

2

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-PassThru

작업하고 있는 항목을 나타내는 개체를 반환합니다. 기본적으로 이 cmdlet은 출력을 생성하지 않습니다.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-PlugInApplicationID<String>

Specifies the identifier for a third party application.

별칭

없음

필수 여부

true

위치

11

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-RememberCredential

Indicates that the credentials supplied at the time of first successful connection are stored in the cache.

별칭

없음

필수 여부

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 URL, an IPv4 address, or an IPv6 address.

별칭

ServerName,DefaultServer

필수 여부

true

위치

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

Indicates that the cmdlet enables split tunneling for this VPN connection profile. When you enable split tunneling, traffic to destinations outside the intranet does not flow through the VPN tunnel. If you do not specify this parameter, split tunneling is disabled.

별칭

없음

필수 여부

false

위치

7

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-ThrottleLimit<Int32>

이 cmdlet을 실행하도록 설정할 수 있는 최대 동시 작업 수를 지정합니다. 이 매개 변수가 생략되거나 값 0이 입력되면 Windows PowerShell®은 컴퓨터에서 실행 중인 CIM cmdlet의 수에 따라 cmdlet에 대한 최적의 제한 한도를 계산합니다. 제한 한도는 현재 cmdlet에만 적용되며 세션이나 컴퓨터에는 적용되지 않습니다.

별칭

없음

필수 여부

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

Indicates that MSCHAPv2 or EAP MSCHAPv2 is used as the authentication method, and that Windows logon credentials are used automatically when connecting with this VPN connection profile.

별칭

없음

필수 여부

false

위치

11

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지가 표시됩니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행될 경우 결과 동작을 표시합니다. cmdlet이 실행되지 않습니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

  • Microsoft.Management.Infrastructure.CimInstance#VpnConnection

    Microsoft.Management.Infrastructure.CimInstance 개체는 WMI(Windows Management Instrumentation) 개체를 표시하는 래퍼 클래스입니다. 파운드 기호(#) 뒤에 오는 경로는 기본 WMI 개체의 네임스페이스 및 클래스 이름을 제공합니다.
    The VpnConnection object contains the VpnConnection configuration settings.

예제

Example 1: Add a VPN connection

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

PS C:\> Add-VpnConnection -Name "Test1" -ServerAddress "10.1.1.1" -PassThru

Example 2: Add a VPN connection with an alternate authentication method

This command adds a VPN connection named Test3 to the server with an IP address 10.1.1.1. This connection uses the MSCHAPv2 authentication method, as specified by the AuthenticationMethod parameter. Additional parameters specify that the connection:

-- Uses the Windows logon credentials (the UseWinlogonCredential parameter)
-- Uses split tunneling (the SplitTunneling parameter)
-- Is stored in the global phone book (the AllUserConnection parameter)
-- Caches the credentials used for the first successful connection (the RememberCredential parameter)

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

PS C:\> Add-VpnConnection -Name "Test3" -ServerAddress "10.1.1.1" -TunnelType Pptp -EncryptionLevel Required -AuthenticationMethod MSChapv2 -UseWinlogonCredential -SplitTunneling -AllUserConnection  -RememberCredential -PassThru

Example 3: Add a VPN connection that uses EAP authentication

This command adds a VPN connection named Test4 to the server with an IP address of 10.1.1.1. This connection uses the default EAP authentication method, as specified by the AuthenticationMethod parameter. The pre-shared key for the connection is specified by the L2tpPsk parameter Additional parameters specify that the connection:

-- Uses split tunneling (the SplitTunneling parameter)
-- Is stored in the global phone book (the AllUserConnection parameter)
-- Caches the credentials used for the first successful connection (the RememberCredential parameter)

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

PS C:\> Add-VpnConnection -Name "Test4" -ServerAddress "10.1.1.1" -TunnelType L2tp -EncryptionLevel Required -AuthenticationMethod Eap -SplitTunneling -AllUserConnection -L2tpPsk "password" -Force -RememberCredential -PassThru

Example 4: Add a VPN connection that uses a custom EAP authentication method

This set of commands adds a VPN connection using a custom EAP authentication method. For more information about custom EAP authentication methods, 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

This command adds a new VPN connection named Test5 to the server with an IP address of 10.1.1.1. This connection is configured to use the custom EAP authentication method specifying the EapConfigXmlStream parameter, and using the EapConfigXmlStream method of the $A variable created earlier. Additional parameters specify that the connection:

-- Uses split tunneling (the SplitTunneling parameter)
-- Is stored in the global phone book (the AllUserConnection parameter)
-- Caches the credentials used for the first successful connection (the RememberCredential parameter)

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

PS C:\> Add-VpnConnection -Name "Test5" -ServerAddress "10.1.1.1" -TunnelType L2tp -EncryptionLevel Required -AuthenticationMethod Eap -SplitTunneling -AllUserConnection -RememberCredential -EapConfigXmlStream $A.EapConfigXmlStream -PassThru

관련 항목

Get-VpnConnection

Set-VpnConnection

Remove-VpnConnection

New-EapConfiguration