How to automate the connecting/disconnecting of a third-party VPN?

I have a third-party VPN software named “Pulse Secure VPN Client (64-bit)”.

Is there a way to automate the connecting/disconnecting of the VPN using PowerShell?

 

Some info:

PS > Get-VpnConnection

(empty result)


 

PS > Get-Service JuniperAccessService

Status Name DisplayName


Running JuniperAccessSe… Pulse Secure Network Service


 

Thank you in advance.

This also means you have a shortcut this software put on your desktop or elsewhere that you’d use to kick it off.

Just use Start-Process to fire off the shortcut and the Get-Process to get the PID, then when needed use Stop-Process.

You can wrap that in a function called say Use-3rdPVpn with a switches that allows -Start or -Stop.