Cisco VPN Client Automatic Login
– 👌
First, we need to use the vpncli.exe command line approach with the -s switch. It works from the command line or script. If you are looking for a solution in C#:
// file = @ “C:Program Files (x86)CiscoCisco AnyConnect Secure Mobility Clientvpncli.exe” var file = vpnInfo.ExecutablePath; var host = vpnInfo.host; profile var = vpnInfo.ProfileName ; var user = vpnInfo.User; var pass = vpnInfo.Password; assert var = “y”; var proc = new process StartInfo = new ProcessStartInfo FileName = file, Arguments = string.Format (“- s”), UseShellExecute = false, RedirectStandardInput = true, RedirectStandardOutput = true, RedirectStandardError = true,; proc.OutputDataReceived + = (s, a) => stdOut.AppendLine (a.Data); proc.ErrorDataReceived + = (s, a) => stdOut.AppendLine (a.Data); // Make sure it doesn’t work, otherwise the call will fail var procFilter = new HashSet
(This may contain additional things that are not required for your specific case.)
[ad_1]
Don’t forget to share this post with friends !