Advertisement
anarquiles

Agregar VPN Powershell

Dec 2nd, 2021
1,196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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..."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement