How to close existing SSL Tunnels via Powershell?

175 Views Asked by At

I want to kill the RDP app, VPN Client app and all its existing tunnels using powershell. The commands below works to kill the apps:

Stop-Process -name mstsc -F
Stop-Process -name SWGVC -F

However, the current tunnel still stays so I can keep pinging any laptop using our office network although VPN is closed.

When I searched how to close the existing VPN tunnels via PowerShell, I see I can find the VPN connections using get-vpnconnection and then do Disconnect-VpnUser but get-vpnconnection returns no data at all. When I go to "Network and Internet" from Settings and check if there is any VPN added, none.

How can I be sure the existing SSL tunnels are closed when the VPN app is killed using powershell? Any help would be appreciated.

Regards

1

There are 1 best solutions below

2
On

Try this command to check the VPN adapters connections

[System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces() | select Name,Description,Operationalstatus