Script to automate VPN connection creation on Windows
Go to file
Juan Ferrer 669c969c04 refs #8159 All users by default 2024-11-12 16:56:44 +00:00
LICENSE Initial commit 2021-03-18 13:10:09 +00:00
README.md First version, script added 2021-03-18 14:21:38 +01:00
windows-vpn.ps1 refs #8159 All users by default 2024-11-12 16:56:44 +00:00

README.md

Windows IPsec configurator

Script to automate VPN connection creation on Windows.

You need to execute this script as administrator.

To be able to execute it you have to manually run the following commnand in PowerShell (also as administrator).

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

To avoid DNS issues because of Windows 10 "smart multi-homed name resolution" you have to manually (it cannot be done via scripting) change the connection metric under:

  • VPN connection > Properties > Networking > TCP/IPv4 > Properties > Advanced...
  • Disable "Automatic metric" and set "Interface metric" to 1.

More info about the issue at:

The EAP XML configuration can be generated from an existing connection using the following commands.

$conn = Get-VpnConnection -Name $vpnName
$conn.EapConfigXmlStream.InnerXml