Login into SonicWALL VPN through a .NET application

2.2k Views Asked by At

I am currently trying to access a SonicWALL VPN, inside of a .NET application. We have all the necessary credentials inside of our database, but I can't find a way to call the SonicWALL Global VPN inside a .NET application to start it.

  • Does SonicWALL have an API of any sort?
  • Or does .NET have a way to access the SonicWALL Global VPN?

I have seen Remote Access Services but not sure if this library can access SonicWALL Global VPNs or just Windows VPNs.

2

There are 2 best solutions below

0
On BEST ANSWER

The answer was simpler then the process I was trying.

You can launch sonicwall vpn client from the command line, and since you can do that obviously you can launch it through .NET using Process.start("path to client", "arguments")

Check out http://www.sonicwall.com/downloads/Global_VPN_Client_21_AdminGuide.pdf on launching sonicwall from the command line.

0
On

First of all the Global VPN Client is unmanaged code, which means no access through .net.

But as OP mentioned you can use the CLI Approach with following options to perform a variety of Global VPN Client actions:

  • /E “Connection Name” – Enables the specific connection.

  • /D “Connection Name” – Disables the specific connection.

  • /Q - Quits a running an instance of the program. Ignored if program is not already running.

  • /A [filename] - Starts the program and sends all messages to the specified log file. If no log file is specified, the default file name is gvcauto.log. If the program is already running, this option is ignored.

  • /U “Username” - Username to pass to XAUTH. Must be used in conjunction with /E.

  • /P “Password” - Password to pass to XAUTH. Must be used in conjunction with /E.


C# Example

An Example Snippet for quiting the application in C# is:

Process.Start(@"C:\Program Files\SonicWALL\Global VPN Client\SWGVC.exe", "/Q");

By the way all these command line options also work for the Dell SonicWALL Global VPN Client Version.