TechShizz | Finally, a Windows 10 VPN solution that doesn't make you want to blow your brains out!

Finally, a Windows 10 VPN solution that doesn't make you want to blow your brains out!

As a system administrator, I use many VPN connections throughout the day. Windows 10 is great, but whoever was in change of the VPN client in windows 10 at Microsoft did not deserve his/her bonus for this edition of windows!! It's slow, buggy, gives you no decent error. Fortunately, Mr gates left the good old rasphone intact so we can use this. 

The problem is, its still clunky loading in Windows 10. It can take 3-10 seconds to load the Rasphone each time you open it.

I've written a PowerShell script to make a tidy folder of useable shortcuts that you can add the to tool bar. Here's how it works.

1. Create a folder called "VPNs" in c:\

2. Right click the task bar > Toolbars > New Toolbar

3. Navigate to the VPNs folder and select it and click 'Select Folder'.

4. Paste this PS Script to s txt file. Save it as a .ps1 file.

Remove-Item -Path C:\VPNs\* -Recurse -Force
$vpnlist = Get-VpnConnection | Select Name -Skip 1
ForEach ($vpnname in $vpnlist.Name ){
$Shell = New-Object -ComObject ("WScript.Shell")
$ShortCut = $Shell.CreateShortcut("C:\VPNs\$vpnname.lnk")
$ShortCut.TargetPath="rasphone.exe"
$ShortCut.Arguments="-d `"$vpnname`""
$ShortCut.WorkingDirectory = "c:\windows\system32\";
$ShortCut.WindowStyle = 1;
$ShortCut.Description = "$vpnname";
$ShortCut.Save()}

5.You can check the status (See what VPNs are connected) with this script.

Get-VpnConnection | Where-Object {$_.ConnectionStatus -eq "Connected" } | Select Name,ConnectionStatus,TunnelType,ServerAddress,SplitTunneling | Format-Table
Pause
Exit

6. You can disconnect all VPNs at the same time with this script.

$vpnlist = Get-VpnConnection | Where-Object {$_.ConnectionStatus -eq "Connected" }
ForEach ($vpnname in $vpnlist.Name ){

  rasdial $vpnname /DISCONNECT;

}

Add comment