Here’s a quick PowerShell script that allows auto-reconnect of Windows VPN connections without having to use VPN Re-dial / Re-connect. You could also use this script to automatically connect the VPN at logon or to stop users disconnecting the VPN manually to bypass company controls.
Make sure to update the VPN Name, the username & password.
To get the script to auto-reconnect we want to create a Windows Scheduled task with an event viewer trigger
The important things here are
This will cause the script to trigger ever time there is a disconnect event.
The latest version of this script can always be found here – https://github.com/ExtendedIT/PowerShell/tree/master/VPN-Reconnection
For any help or custom scripts email – [email protected]