View difference between Paste ID: 0YrYEP57 and rnr5ZRE2
SHOW: | | - or go back to the newest paste.
1
####Variables####
2
#Add name of VPN in Windows here
3
$Name = "VPN_Name"
4
#Server IP Address goes here (WAN IP)
5
$ServerAddr = "192.168.168.168"
6
#L2TP Pre-Shared Key
7
$L2TPPSK = "PRESHAREDKEY"
8
#Domain Name Suffix Ex. Contoso.local
9
$DnsSuffix = "Contoso.local"
10
11
######Script starts here#######
12
Import-Module VpnClient
13
Add-VpnConnection -Name $Name -ServerAddress $ServerAddr -AuthenticationMethod Pap -TunnelType L2tp -EncryptionLevel Optional -L2tpPsk $L2TPPSK -DnsSuffix $DnsSuffix -Force
14
Write-Host "VPN Connection has been created..."