I created a server that needed to be connected to the VPN at all times. Here's three ways of doing it, but I used the last way - a scheduled task that repeatedly executes every 5 minutes after system start up, meaning if the VPN goes down and then up, it will still reconnect.
Application based triggering (Windows 8+):
- PowerShell:
Add-VpnConnectionTriggerApplication [-Name] <string> –ApplicationID <String[]> -PassThru
Source
Quick and Dirty (Windows XP+):
- Save credentials in VPN connection
- Drag a shortcut to the 'Startup' folder
Source
Schedule a task to execute at System Startup
- Create a scheduled Task (I had it execute every 5 minutes after start indefinitely for auto-redial)
- Create batch script:
rasdial "My VPN Connection" <username> <password>
Source