Add-SCVPNConnection
语法
Add-SCVPNConnection
[-VMMServer <ServerConnection>]
[-VMNetworkGateway] <VMNetworkGateway>
[-Name <String>]
[-Description <String>]
[-TargetIPv4VPNAddress <String>]
[-TargetIPv6VPNAddress <String>]
[-EncryptionMethod <VPNEncryptionMethod>]
[-IntegrityCheckMethod <VPNIntegrityCheckMethod>]
[-CipherTransformConstants <VPNCipherTransformConstants>]
[-AuthenticationTransformConstants <VPNAuthenticationTransformConstants>]
[-PFSGroup <VPNPFSGroup>]
[-DHGroup <VPNDHGroup>]
-Protocol <VPNProtocol>
[-AuthenticationMethod <VPNAuthenticationMethod>]
[-Secret <RunAsAccount>]
[-Certificate <ClientCertificate>]
[-IPSecMainSALifeTimeSeconds <UInt32>]
[-IPSecMainSALifeTimeKiloBytes <UInt32>]
[-IPSecQuickSALifeTimeSeconds <UInt32>]
[-IPSecQuickSALifeTimeKiloBytes <UInt32>]
[-IPSecIdleDisconnectSeconds <UInt32>]
[-LocalTrafficSelectors <TrafficSelector[]>]
[-RemoteTrafficSelectors <TrafficSelector[]>]
[-MaximumBandwidthInboundKbps <UInt64>]
[-MaximumBandwidthOutboundKbps <UInt64>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
Add-SCVPNConnection
[-VMMServer <ServerConnection>]
[-VMNetworkGateway] <VMNetworkGateway>
[-Name <String>]
[-Description <String>]
[-TargetIPv4VPNAddress <String>]
[-TargetIPv6VPNAddress <String>]
-Protocol <VPNProtocol>
[-MaximumBandwidthInboundKbps <UInt64>]
[-MaximumBandwidthOutboundKbps <UInt64>]
[-GRETunnel]
[-GREKey <UInt32>]
[-GREIPv4Address <String>]
[-GREIPv6Address <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
Add-SCVPNConnection
[-VMMServer <ServerConnection>]
[-VMNetworkGateway] <VMNetworkGateway>
-NextHopNetwork <VMNetwork>
[-Name <String>]
[-Description <String>]
-Protocol <VPNProtocol>
[-MaximumBandwidthInboundKbps <UInt64>]
[-MaximumBandwidthOutboundKbps <UInt64>]
-IPAddresses <String[]>
-PeerIPAddresses <String[]>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
说明
Add-SCVPNConnection cmdlet 将虚拟专用网络 (VPN) 连接到虚拟机网络,以建立从 Virtual Machine Manager (VMM) 托管网络网关到另一终结点的站点到站点隧道。
示例
示例 1:添加 VPN 连接
PS C:\> $VmNetworkGateway = Get-SCVMNetworkGateway -Name "VMGateway01"
PS C:\> $RunAsAccount = Get-SCRunAsAccount -ID "972567d5-96ad-472e-9790-831bae5fd69c"
PS C:\> $VpnConnection = Add-SCVPNConnection -AuthenticationMethod "PSKOnly" -AuthenticationTransformConstants "SHA196" -CipherTransformConstants "AES256" -DHGroup "Group2" -EncryptionMethod "AES256" -IntegrityCheckMethod "SHA1" -PFSGroup "PFS2048" -Protocol "IKEv2" -Name "IPSec" -TargetIPv4VPNAddress "100.100.100.100" -Secret $RunAsAccount -VMNetworkGateway $VmNetworkGateway
第一个命令获取名为 VMGateway01 的网络网关,然后将其存储在$VmNetworkGateway变量中。
第二个命令获取运行方式帐户,然后将其存储在$RunAsAccount变量中。
此帐户用于添加 VPN 连接。
最后一个命令将 VPN 连接添加到$VmNetworkGateway中的虚拟机网络网关,然后将其存储在$VpnConnection变量中。
参数
-AuthenticationMethod
指定虚拟专用网络 (VPN) 身份验证方法。
有效值为:PSKOnly、MachineCertificates。
Type: | VPNAuthenticationMethod |
Accepted values: | PSKOnly, MachineCertificates |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
指定虚拟专用网络 (VPN) 转换常量。
有效值为:
- SHA256128
- MD596
- SHA196
- GCMAES128
- GCMAES192
- GCMAES256
Type: | VPNAuthenticationTransformConstants |
Accepted values: | SHA256128, MD596, SHA196, GCMAES128, GCMAES192, GCMAES256, SHA256, None |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Certificate
指定一个安全证书对象。
Type: | ClientCertificate |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
指定虚拟专用网络密码转换常量。
有效值为:
- DES
- DES3
- AES128
- AES192
- AES256
- GCMAES128
- GCMAES192
- GCMAES256
Type: | VPNCipherTransformConstants |
Accepted values: | DES, DES3, AES128, AES192, AES256, GCMAES128, GCMAES192, GCMAES256, None |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
指定 VPN 连接的说明。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DHGroup
指定虚拟专用网络 (VPN) Diffie-Hellman (DH) 组。
有效值为:
- 无
- Group1
- Group2
- Group14
- ECP256
- ECP384
- Group24
Type: | VPNDHGroup |
Accepted values: | None, Group1, Group2, Group14, ECP256, ECP384, Group24 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EncryptionMethod
指定虚拟专用网络 (VPN) 加密方法。
有效值为:
- DES
- DES3
- AES128
- AES192
- AES256
Type: | VPNEncryptionMethod |
Accepted values: | DES, DES3, AES128, AES192, AES256, CBCDES, CBCDES3, AES128CBC, AES192CBC, AES256CBC, GCMAES128, GCMAES192, GCMAES256 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-GREIPv4Address
指定泛型路由封装 (GRE) IPv4 地址。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-GREIPv6Address
指定 GRE IPv6 地址。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-GREKey
指定 GRE 键。
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-GRETunnel
指示此 cmdlet 使用 GRE 隧道。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IntegrityCheckMethod
指定虚拟专用网络 (VPN) 完整性检查方法。
有效值为:
Type: | VPNIntegrityCheckMethod |
Accepted values: | MD5, SHA1, SHA256, SHA384, SHA196 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPAddresses
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPSecIdleDisconnectSeconds
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPSecMainSALifeTimeKiloBytes
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPSecMainSALifeTimeSeconds
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPSecQuickSALifeTimeKiloBytes
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPSecQuickSALifeTimeSeconds
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
指定跟踪作业进度,并将其存储在此参数命名的变量中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LocalTrafficSelectors
Type: | TrafficSelector[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MaximumBandwidthInboundKbps
指定最大入站带宽(以 kbps 为单位)。
Type: | UInt64 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MaximumBandwidthOutboundKbps
指定最大出站带宽(以 kbps 为单位)。
Type: | UInt64 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
指定 VMM 对象的名称。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NextHopNetwork
指定 VMNetwork 对象。
Type: | VMNetwork |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OnBehalfOfUser
指定用户名。
此 cmdlet 代表此参数指定的用户运行。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OnBehalfOfUserRole
指定用户角色。
若要获取用户角色,请使用 Get-SCUserRole cmdlet。
此 cmdlet 代表此参数指定的用户角色运行。
Type: | UserRole |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PeerIPAddresses
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PFSGroup
指定虚拟专用网络 (VPN) 完美转发保密 (PFS) 组。
有效值为:
- 无
- PFS1
- PFS2
- PFS2048
- ECP256
- ECP384
- PFSMM
- PFS24
Type: | VPNPFSGroup |
Accepted values: | None, PFS1, PFS2, PFS2048, ECP256, ECP384, PFSMM, PFS24, PFS14 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
指定触发此操作 (PRO 提示) 的性能和资源优化提示的 ID。
此参数允许审核 PRO 提示。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Protocol
指定 VPN 协议。
此参数的可接受值为:
Type: | VPNProtocol |
Accepted values: | IKEv2, L2TP, PPTP, GRE, L3, IPSec |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RemoteTrafficSelectors
Type: | TrafficSelector[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
指示作业异步运行,以便控件立即返回到命令 shell。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Secret
指定运行方式帐户。
若要获取运行方式帐户,请使用 Get-SCRunAsAccount cmdlet。
Type: | RunAsAccount |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TargetIPv4VPNAddress
指定 IPv4 格式的目标 VPN 地址。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TargetIPv6VPNAddress
指定 IPv6 格式的目标 VPN 地址。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
指定VMM 服务器对象。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMNetworkGateway
指定虚拟机网络网关对象。
若要获取 VMNetworkGateway 对象,请使用 Get-SCVMNetworkGateway cmdlet。
Type: | VMNetworkGateway |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |