Skip to main content
Add VPN With Powershell
  1. Posts/

Add VPN With Powershell

·90 words·1 min·
Snippets Powershell Windows
May Meow
Author
May Meow
MayMeow is a developer and cybersecurity enthusiast with a passion for cryptography, DevSecOps, and open-source contributions. They enjoy creating tools that strengthen digital security, blending creativity and technology to innovate in fields like PHP and .NET. Always exploring new frontiers in tech, MayMeow is dedicated to safeguarding the digital landscape through their work.

Ok when you need to configure vpn on more PC is easier to do this with powershell than with mouse clicking … Here it is example for L2TP oveer IPSec.

Add-VpnConnection -Name "<vpn-name>" -ServerAddress "<address-to-your-server>" -TunnelType "L2tp" -AuthenticationMethod Chap,MSChapv2,Pap -L2tpPsk "<your-psk>"

or create script for it so you don’t need to remmer all that options.

# add-l2tp.ps1
param($name, $server, $psk)

Add-VpnConnection -Name $name -ServerAddress $server -TunnelType "L2tp" -AuthenticationMethod Chap,MSChapv2,Pap -L2tpPsk $psk

Then all what you need to do is call your script:

.\add-l2tp.ps1 -name "My VPN" -server "vpnserver.example.com" -psk "mySu9erS3cr3tPSK"
Reply by Email

Related

How to Install and Configure Samba
·432 words·3 mins
Administration Notes Guide Wiki File Sharing Linux Windows
Sending Strings as Files with CakePHP server response
·83 words·1 min
PHP Back End Cakephp Php
My Selfhosting Workflow
·804 words·4 mins
Linux WIP