Detect VPN Connection State with PowerShell
I wrote this script because I had a need to detect the current state of a VPN connection. With Windows 10, you can use the “Get-VpnConnection” cmdlet. However, if you are working in an environment where that commandlet is not available you can use a WMI query to determine the VPN Connection State.