May Meow logo

May Meow

Subscribe
Archives
October 5, 2021

Add VPN With Powershell

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"

💜 Thank You!

URLs

  • My omg.lol page
  • What am I doing now?
  • You can also check my status page or micro.blog if you want know what I'm doing

Projects

  • I hosing my projects on GitHub
  • I'm currently working on Api Client for the omg lol service.
Don't miss what's next. Subscribe to May Meow:
About Bluesky
This email brought to you by Buttondown, the easiest way to start and grow your newsletter.