Link to home
Start Free TrialLog in
Avatar of officertango
officertango

asked on

Cisco AnyConnect VPN

Is there a way to setup Cisco AnyConnect to connect automatically for laptop users?
Avatar of Qlemo
Qlemo
Flag of Germany image

The only way I got Cisco AnyConnect VPN (SSL) to run automated is by using a PowerShell (or VBS) script.
Add-Type -Assembly System.Windows.Forms

Push-Location "$env:ProgramFiles\Cisco\Cisco AnyConnect Secure Mobility Client"
Start-Service vpnagent | Out-Null
Start-Process 'vpncli.exe' -ArgumentList 'connect vpn.YourGatewayi.com'
sleep 3
'YourRealm', 'YourUser','YourPassword', 'y' | % { sleep -m 100;  [Windows.Forms.SendKeys]::SendWait("$_{ENTER}") }
<# Following line are not required, if you want to keep the connection always-on #>
while (.\vpncli.exe status | Select-String 'Connecting') { Write-Host -NoNewline '.' }
Read-Host 'Return to stop VPN ...' | Out-Null
.\vpncli.exe disconnect
Stop-Service vpnagent | Out-Null

Open in new window

Put a link with
  Powershell -File C:\PathToFile\File.ps1
into AutoStart of the user, and that should be it.

Note that most Admins don't like such a file on a laptop moving all around, because you have the connection information in plain text - not much of security here if someone not authorized gets access to the laptop.
Avatar of officertango
officertango

ASKER

you are right, it is not very secured.
If you just use a link like this:
"%ProgramFiles%\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" connect vpn.YourGatewayi.com

Open in new window

all the login info needs to be typed in by the user - that might be a better idea.
ASKER CERTIFIED SOLUTION
Avatar of officertango
officertango

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
na