I want to connect automatically. Now I must enter the credential manually :(
I don't remember exactly how we did the integration but I remember that AnyConnect is a pain. There is no way to provide the username and password to the command line. Maybe we could do something with a macro?
David Hervieux
I think in the future cisco will only provide the AnyConnect client, because there are no update for the cisco VPN client any more.
So I think the AnyConnect Client AddOn must be better in future :(
I will try the Macro-workaround
We will try to improve it and find a workaround
David Hervieux
Any news on this, having the same issue, need to supply the password and that is a pain
Regards,
Ingvar Orn Ingolfsson
System Engineer
Axdata AS - Norway
Nothing new for now. Have you tried the Macro?
David Hervieux
Which macro, if I can find a solution to this then it would be just great. We are still in the process of deciting if we should buy the RDMS Ent and if I can solve this then I´m atleast 10 steps closer to buying since VPN has always been a pain for uss here.
Regards,
Ingvar Orn Ingolfsson
System Engineer
Axdata AS - Norway
In the event tab page, you can configure a macro to be executed after the connection
David Hervieux
I had tried this before but it only runs after the rdp connection is on, now I have written a ps script that does this for me and I'm starting it from the script section in before connection in events.
But have not figured out how to take the username and password that is in credential repository and use that for the ps script, so now I have the password and username in the script.
Regards,
Ingvar Orn Ingolfsson
System Engineer
Axdata AS - Norway
I have the following parameters in the PS script now.
-VPNHost
-Username
-Password
the argument I'm trying to use is -VPNhost vpn.domain.com -Username $USERNAME$ -Password $PASSWORD$
This is working great with the host and the username put I just receive the password in the script as $PASSWORD$
If I use the same arguments and just type in the password then it's working.
So what am I doing wrong here, is it not possible to get the password from the credential depository or is my argument just simple wrong?
Regards,
Ingvar Orn Ingolfsson
System Engineer
Axdata AS - Norway
Are you sure that Anyconnect support the password parameter? Do you mean type the password in AnyConnect or hard code the password in the script?
David Hervieux
Hi again, just to clarify what I'm doing now.
I have written a powershell script that takes in 3 parameters who are -vpnhost, -username and -password. This is sent from RDM as argument.
This is the argument I send now: -VPNhost vpn.domain.com -Username $USERNAME$ -Password $PASSWORD$
And the script then receives the host and username correctly as from the credential repository (prompts to choice which cred) but the password is sent as $PASSWORD$.
But then I change the argument to: -VPNhost vpn.domain.com -Username $USERNAME$ -Password thepassword
Then everything works like a charm.
So my problem is that it seems like the RDM is not fetching the password like the username from the repository, any brilliant ideas here ;)
This is the powershell script if you like to try this.
<code>
#Parameters for the script
param (
[string]$VPNHost = $(throw "-VPNHost is required."),
[string]$username = $(throw "-username is required."),
[string]$Password = $(throw "-password is required.")
)
#Please check if file exists on following paths
[string]$vpncliAbsolutePath = 'C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe'
[string]$vpnuiAbsolutePath = 'C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client\vpnui.exe'
#Get the system forms assembly
Add-Type -AssemblyName System.Windows.Forms -ErrorAction Stop
#Set foreground window function
#This function is called in VPNConnect
Add-Type @'
using System;
using System.Runtime.InteropServices;
public class Win {
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetForegroundWindow(IntPtr hWnd);
}
'@ -ErrorAction Stop
#quickly start VPN
#This function is called later in the code
Function VPNConnect()
{
Start-Process -FilePath $vpncliAbsolutePath -ArgumentList "connect $VPNHost"
$counter = 0; $h = 0;
while($counter++ -lt 1000 -and $h -eq 0)
{
sleep -m 20
$h = (Get-Process vpncli).MainWindowHandle
}
#if it takes more than 20 seconds then display message
if($h -eq 0){echo "Could not start VPNUI it takes too long."}
else{[void] [Win]::SetForegroundWindow($h)}
}
#Terminate all vpnui processes.
Get-Process | ForEach-Object {if($_.ProcessName.ToLower() -eq "vpnui")
{$Id = $_.Id; Stop-Process $Id; echo "Process vpnui with id: $Id was stopped"}}
#Terminate all vpncli processes.
Get-Process | ForEach-Object {if($_.ProcessName.ToLower() -eq "vpncli")
{$Id = $_.Id; Stop-Process $Id; echo "Process vpncli with id: $Id was stopped"}}
#Disconnect from VPN
echo "Trying to terminate remaining vpn connections"
start-Process -FilePath $vpncliAbsolutePath -ArgumentList 'disconnect' -wait
#Connect to VPN
###Err seeking, display the arguments the script got from RDM
echo "Connecting to VPN address '$VPNHost' as user '$username' with password '$Password'."
VPNConnect
#Write login and password, sends first one ENTER to accept protocol answer.
[System.Windows.Forms.SendKeys]::SendWait("{Enter}")
[System.Windows.Forms.SendKeys]::SendWait("$username{Enter}")
[System.Windows.Forms.SendKeys]::SendWait("$Password{Enter}")
#Start vpnui
start-Process -FilePath $vpnuiAbsolutePath
##Err seeking, Wait for keydown
echo "Press any key to continue ..."
try{$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")}catch{}
</code>
Thanks for the patient and a great service.
Regards,
Ingvar Orn Ingolfsson
System Engineer
Axdata AS - Norway
Hi,
Great script. I think that the only thing missing is in the Advanced tab page. Make sure that Allow Password in variable is checked
David Hervieux
Thanks for the script, it works awsome!
Hi
thanks for the script
I am having troubles getting th password to work
I keep getting
username:[admin] mypassword
Password:_
I doesnt seem to put the password in the right place.
I have tried the mypassword in arguments but it doesn't help
could someone help me?
Hey guys!
this anyconnect really is a pain in the A..!
i've seen several forum posts about this addon, but none seem to work. I can get the command line to work but do not know how to translate this to RDM. which would make me king of the depertment :-)
so here is what I have using the command line (something others may have discovered as well)
vpncli.exe -s connect <hostname> <c:\temp\answer.txt
in the answer.txt are the username and the password divided only using a new line, like so;
username
password
you cannot replace the txt file with parameters $username$ $password$. it don't work
So have some coffee and make it work!
Hi ReDxXx,
This seems to be a nice workaround. I will take a coffee and give it a try :) We are leaving for TechEd soon but you can expect an update as soon as we returned.
David Hervieux
I'm about to buy Remote Desktop Manager or something similar to our employers in my company. Most of our customer use Cisco AnyConnect and therefor I'm looking for a program to handle this too. We have about 1000 customer and about 1500 Devices to control. Are there any chance that connection with AnnyConnect together with Username and Password will be fixed in short time. RDM is a fine manager and got what we are looking for, except the AnyConnection VPN problem.
Best regards, Jan
Hi, you can use the script above but you will need to go into the advance tap and change so the client allows to send the password to the script.
Also then go into File-Templates select Session and then Other, double click Powershell
In the new window that pops up go into Advanced and click Allow Password in variable (second line from top number two), now click OK.
All script now in the future will use this template and you will be a happy little fellow to skip this step every time in the future.
Regards, Ingvar
Regards,
Ingvar Orn Ingolfsson
System Engineer
Axdata AS - Norway
Hi,
I need help to test an update. We don't have a Cisco VPN to test here.
I updated the Cisco AnyConnect add-on to support auto-login with the ReDxXx method.¸
First if you let the user name and password empty it should be the same behaviour that you know.
With user name and password it should create a temporary file to provide credentials to the VPN.
Of course, if you try the new method you must not use any other scripts or macros.
You just have to replace the VPNAddon.dll with the new one.
%LocalAppData%\Devolutions\RemoteDesktopManager
Please make a backup of the old dll because no real tests have been made.
Waiting for your feedback:)
Best regards,
André Sanscartier
VPN2.5.1.0.zip
I have just tested with the new dll both with my credentials set to default and embedded and there is no change. Still times out without connecting. It is like there is not enough time for RDM to enter the credentials before the window closes.
edited by wgentry on 5/22/2014
Hi Andre,
2bad for now but keep it up!
Hi again, and thanks #ingvarorn.
One of my tester, came up with another issue, as I would like to ask about.
Some of our customer are using Cisco VPN + SMS Passcode to make the VPN Connection. The SMS Passcode is an static code, but I can't find the place to add this SMS Passcode in the VPN Connection tab i RDM.
It might not be possible or what ?
Best regards Jan
Hi,
I don't think it's possible to send the SMS code to the command line. We already have issue just with the username and password.
David Hervieux
I think I have a workaround...
'Check is allready running
Dim objOldProcessCLI As System.Diagnostics.Process = System.Diagnostics.Process.GetProcessesByName("vpncli").FirstOrDefault
If Not objOldProcessCLI Is Nothing Then
objOldProcessCLI.Kill()
System.Threading.Thread.Sleep(1500)
End If
Dim objOldProcessGUI As System.Diagnostics.Process = System.Diagnostics.Process.GetProcessesByName("vpnui").FirstOrDefault
If Not objOldProcessGUI Is Nothing Then
objOldProcessGUI.Kill()
System.Threading.Thread.Sleep(1500)
End If
Dim objProcess As New System.Diagnostics.Process
objProcess.StartInfo.FileName = installationPath
objProcess.StartInfo.Arguments = processArgumentBuilder.ToString()
objProcess.StartInfo.WindowStyle = Diagnostics.ProcessWindowStyle.Normal
objProcess.Start() '(installationPath, processArgumentBuilder.ToString())
If (ciscoAnyConnectVPNConfiguration.WaitDelay > 0) Then
AddOnServices.ShowWaitVPN(ciscoAnyConnectVPNConfiguration.WaitDelay * 1000)
SetActiveWindow(objProcess.MainWindowHandle)
Else
SetActiveWindow(objProcess.MainWindowHandle)
End If
System.Windows.Forms.SendKeys.SendWait(ciscoAnyConnectVPNConfiguration.UserName)
SetActiveWindow(objProcess.MainWindowHandle)
System.Windows.Forms.SendKeys.SendWait("{ENTER}")
System.Threading.Thread.Sleep(1500)
SetActiveWindow(objProcess.MainWindowHandle)
System.Windows.Forms.SendKeys.SendWait(ciscoAnyConnectVPNConfiguration.Password)
SetActiveWindow(objProcess.MainWindowHandle)
System.Windows.Forms.SendKeys.SendWait("{ENTER}")
objProcess.WaitForExit(ciscoAnyConnectVPNConfiguration.WaitDelay * 1000)
And of course, at the top of the CiscoAnyConnectVPNAddOn class
Declare Function SetActiveWindow Lib "user32.dll" (ByVal hwnd As Integer) As Integer
Hi,
This time I implemented the LifeBlast method.
But I'm still not able to test it.
I'm waiting for your feedback.
If there is no credential it's the same previous behaviour.
Do not use macro or any script to test.
You just have to replace the VPNAddon.dll with the new one.
%LocalAppData%\Devolutions\RemoteDesktopManager
Best regards everyone,
André Sanscartier
VPN2.5.1.1.zip
Andre,
I have tested the new DLL. end YES it works! the long delay of 15 seconds may get annoying. but i think this could be a cisco issue. As we have several customers where the 15 seconds is definately needed. whereas with one customer the connection is established within 5 seconds. The latter has a firewall. the others a router.
Great work!. Tnx. looking forward 2 the update.
edited by ReDxXx on 5/27/2014
Good to hear that it works :)
Hi,
The Wait delay is configurable in the session. You could reduce it.
Best regards,
André Sanscartier
Andre,
I know, but Anyconnect needs this time to connect, and check all his things for some reason. And like I said, when connecting with anyconnect to ASA 550x Firewall, its much quicker.
When connecting to a Cisco router it takes longer.
But hey! that's a whole different forum right. :-)
Hi,
I'm trying to connect to a Cisco anyconnect VPN, but there is a problem that they only have a self-signed certificate from there Cisco Firewall.
And the script is now asking me if i really want to connect to this vpn, because it is untrusted.
So can you please add an "y" for yes and an {ENTER} to your script. So that i can again connect to an anyconnect vpn.
I tested the y and {Enter} combination in the CLI!
Best regards
Hi,
Could you give a try to this new version ?
You just have to replace the dll in %LOCALAPPDATA%\Devolutions\RemoteDesktopManager
But this version needs the RDM Beta version to load.
Regards,
edited by asanscartier on 6/23/2014
André Sanscartier
VPN3.0.1.0.zip
Hi,
thx for the really quick respones!
But this update is not working for me!
If I start the VPN connection. It's assume to connect and open the cli. But as first variable RDM puts in the username and the password, but not the "y" for yes.
So the right order would be "y" then username and then the password.
Can you please correct this?
Regards
Sebastian
Hi,
I changed the order as required.
I hope that it is ok now.
Best regards,
André Sanscartier
VPN3.0.1.1.zip
hi,
thx, it works now.
but there is also another problem:
if Cisco AnyConnect Secure Mobility Client vpnui.exe runs (Autostart by default) cmd-connect fails.
So I did Events->Before connect->Command line: taskkill /F /IM vpnui.exe
Works great so far. But to get Info that VPN is online, I want to start VPNUI.exe after connecting.
Events->After connect doesn't offer the feature: Command line
Plz add Feature: Command line to Events->After connect or offer us a 2nd solution.
Maybe it will be worth integrating this functions into the AddOn:
Before: taskkill /F /IM vpnui.exe
After: %Program Files (x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpnui.exe
regards,
markus
Kind Regards
Markus
======================
Hi,
The add-on is supposed to already kill Vpnui and Vpncli before to open if a user name is provided.
It doesn't work ?
Regards,
André Sanscartier
Hi,
The killing thing is also not working for me!
Thanks for the rest. The untrusted feature is working great. :-)
edited by konig99 on 6/26/2014
sorry 4 delay,
killing vpnui.exe is not working, plz check if integrated.
to start vpnui.exe after connect, what will you prefer:
option in plugin to start vpnui.exe after connecting or
extending functionality of "Events->After connect"?
edited by SMG on 6/26/2014
Kind Regards
Markus
======================
Hi,
I changed the way it kills VpnUi and VpnCli.
I added 2 options in the settings to select kill.
But it's not tested.
Best regards,
André Sanscartier
VPN3.0.1.2.zip
hi andré,
2nd option to kill works, 1st generates error-report and doesn't work 4 me (RDM 9.4.8.0).
Kind Regards
Markus
======================
Hi,
I added a delay between kills and VPN opening.
Regards,
André Sanscartier
VPN3.0.1.3.zip
Hi,
Any news ?
Did someone has the time to test it ?
Regards,
André Sanscartier
Andre,
3.0.1.3 works for me. using the credentials manager in RDM. no scripts or nothing. all RDM
Thanks!
André Sanscartier
Hi,
sorry for the late reply! Didn't had that much time.
The latest plugin VPN3.0.1.3 is also working for me! :-)
Thanks a lot!
Regards
Hi,
The latest fix caused side effects to others users and I had to changed the add-on once again.
Could you check if it is still working for you.
Regards,
edited by asanscartier on 7/8/2014
André Sanscartier
VPN3.0.1.4.zip
Hi,
If I enable "Connect anyway confirmation" the y is inserted to early behind the username. This happens with 3.0.1.3 and 3.0.1.4. Is there anything I need to configure different?
Thanks and regards
Hi,
Furthermore to my last post we are getting a "accept? [y/n]" question AFTER authentication. Maybe that can be fixed also?
Thanks and regards.
Hi reiso_last,
It will be a new feature because this sequence works with others.
I will add the possibility to put the Y after the authentication.
Regards,
André Sanscartier
Hi Andre,
Thanks for the prompt answer. Will wait for an update then.
Regards
Hi,
As promised I added "Before authentication" and "After authentication" choices for the "Connect anyway confirmation" option.
Could you try it and give us feedback please ?
Just have to replace the dll in %LocalAppData%\Devolutions\RemoteDesktopManager
Best regards,
André Sanscartier
VPN3.0.1.5[1].zip
Hi Andre,
Can confirm that "After authentication" works perfect. Thanks a lot.
Regards
Michael
hi André,
you posted 3.0.1.5 twice here and in forticlient-thread.
is it the same or is there a difference?
regards,
Markus
Kind Regards
Markus
======================
It's the same dll because it contains both add-ons.
David Hervieux
Place the Powershell script on a share and add a Generic VPN. That way you can place RDM in offline mode after you start a VPN.
Host: vpn.contoso.com
executable: C:\windows\system32\windowspowershell\v1.0\powershell.exe
opening arguments: -file "\share\script.ps1" -VPNHost $HOST$ -Username $USERNAMER$ -Password $PASSWORD$
@Jan
Yes it should work.
David Hervieux
Hello
We just bought RDM version 9.2.10.0
I have found the file VPNAddOn.dll that I must overwrite.
When I start RDM after I have copyed the VPNAddOn.dll, it comes with many errors when starting RDM.
Error:
Duplicate add-on ID found: Check Point Endpoint Security
VPN a05f55e-523c-4ee6-af7f-4433ceb391a0
Dublicated add-on ID found: bitwise Tunnelier -
A lot of numbers:-)
And about 13 more errors in other kinds of VPN
Can you help me with what I'm doing wrong?
Best regards
Jan Iversen
Hi iversenjan,
remove the other VPNAddOn.dll from the folder. Also if it has an other name RDM is somehow recognice it.
Regards
Sebastian
make sure that you use Addonn version 2.5.1.1 with RDM 9.2.10.0
Addon 3.0.1.5+ is for RDM10 Beta as it needs .Net4
edited by SMG on 9/4/2014
Kind Regards
Markus
======================
Hi, we have found out that there is a scenario that breaks the AnyConnect totally.
We have one user that have 2 SSL-Groups on their Cisco VPN that means that we need to select a SSL-Group before we can enter the user and password.
The solution to this would be adding a option to the AnyConnect plugin til send a number first like for the customer we have that number would be 0 for the first group and 1 for the second group. This would of course need to be option that would normally be disabled since most company only have one group and then the VPN gateway does not ask for a group.
I attach a picture to explain better the error we are facing.
The info RDM is sending is user and password but of course then the user will be filled in at SSL-Group prompt and the password at user prompt.
Hope this will be added to future releases of the add-on.
Regards,
Ingvar Orn Ingolfsson
System Engineer
Axdata AS - Norway
Hi,
I will assign this to André. He will take a look next week (he not working tomorrow). I don't know if it's possible but at least we will check what we can do.
David Hervieux
Thanks man
Regards,
Ingvar Orn Ingolfsson
System Engineer
Axdata AS - Norway
Hi,
Could you give a try to this add-on update ?
I think that I added the desired feature.
Just have to replace the VPNAddOn.dll in the %LocalAppData%\Devolutions\RemoteDesktopManager\ folder.
Best regards,
André Sanscartier
VPN3.0.2.0.zip
Hi André,
I have tested this now and this works.
Thanks a lot.
Regards,
Ingvar Orn Ingolfsson
System Engineer
Axdata AS - Norway
Hey Guys,
We have the same setup. 1 customer, 2 profiles. i've downloaded the dll, but where do we enter the number for the desired profile?
Under settings on the VPN.
Select "Specify group number" then the first group will be 0, second 1 and so on....
Regards,
Ingvar Orn Ingolfsson
System Engineer
Axdata AS - Norway
vpn_w_group.jpg
Cisco AnyConnect VPN Client Add-on by Devolutions inc.
v3.0.11.0
This is on the site... really? Who privided u guys this code?
Hi Guys,
We're having some trouble connecting to the Cisco AnyConnect VPN. We want to automatically input the username and password. But when we do this, the script puts in the field username half of the password and immediately after it puts the username.
When not saving the password, it correctly fills in the username and we can manually fill in the password. This works fine.
Do you have an idea how we can fix this issue?
Kind regards,
Maxime
Hello Maxime,
I can't reproduce the issue on my end so I'm curious if this is a weird timing issue. I attached a version of the add-on that adds delay between sending the username and the password. Could you test it out and give some feedback? The installation path for the DLL is %LocalAppData%/Devolutions/RemoteDesktopManager . Be sure to backup your current VPNAddOn.dll before replacing it with this one, just in case.
Regards,
Hubert Mireault
VPN3.0.13.0.zip
Hi Hubert,
thank you for the file. Unfortunately, I cannot start the program with the new dll file. First I had some error messages about duplicates and now it shows the error "Value Dispose() cannot be called while doing".
Kind regards,
Maxime
I'll try to reproduce this issue. Can you make sure the previous DLL still works, just in case?
Edit: I forgot to mention, don't keep both DLL's in the %Localappdata% folder, it might cause this issue as it would try loading both.
edited by Hubert Mireault on 7/27/2015
Hubert Mireault
Hi Hubert,
thanks for the info. Now I've managed to load the new dll it still writes first (half) the password and the username. Then it enters to display the password line and it then waits for input.
Putting a fixed group number doesn't solve it either.
Kind regards,
Maxime
Could you send me an email to hmireault (at) devolutions.net with an export of your AnyConnect entry? Maybe there's a setting I'm missing since I still can't reproduce the issue.
To export the entry, you can right click it > Export > Export Selection (.rdm)
Regards,
Hubert Mireault
After testing a few things out with Maxime's help, the issue is resolved. An updated version of the add-on is available on our add-on page here http://remotedesktopmanager.com/Home/AddOn
Regards,
Hubert Mireault
I'm still having this issue as well where the password isn't getting filled in.
I checked and it looks like I have v3.0.13.0 released 6/8/15. That version number matches the link above. Is there a newer version?
Hello Don,
Hubert is currently on vacation. I will make sure he answer you as soon as he gets back.
David Hervieux
Actually, I updated Anyconnect and the problem has been resolved.
Hi!
I would like to resurrect this thread if you dont mind. We continue to have issues with the anyconnect client. Our issue is that we have some workstations that can run all these flawlessly and some who end up with the credential information being inputted incorrectly or slowly or intermittently - just erratic behavior. However when we invoke the vpncli for anyconnect via a powershell script it works fine for everyone no matter what. The problem with that is that then we have to write these scripts and embed credential info into it etc etc. I believe that if I can figure out why this only happens on certain people's workstations that this will work great for me. Why would invoking the vpncli from powershell correct these issues but when it is invoked by RDM it struggles and fails only for a percentage of workstations?
We have tried a number of things - we have the latest anyconnect client installed 4.2, we have tried 64bit mode vs 32 bit mode. I have machines with Windows 10 and Windows 7 that work fine. Other Windows 7 machines have issues. We also had a support session with Devolutions but we had no success to make this work. Clearly this thread is pretty old so perhaps some of you after battling with this might have an idea or what the issue is here? We have about 40 more clients who are moving to anyconnect from the old client. I just want the addon to work without having to configure embedded scripts to correct this environment issue.
Any help would be appreciated. Below si the powershell script that works for those who are having this issue:
#Source www.cze.cz
#This script is tested with "Cisco AnyConnect Secure Mobility Client version 3.0.5080"
#Please change following variables
##FROM WEB SITE
## http://www.velocityreviews.com/threads/automatic-login-using-cisco-vpn-client.947891/
##
#IP address or host name of cisco vpn
[string]$CiscoVPNHost = [removed]
[string]$GROUP = "1"
[string]$Login = [removed]
[string]$Password = [removed]
[string]$Confirmation="y"
#Please check if file exists on following paths
[string]$vpncliAbsolutePath = 'C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe'
[string]$vpnuiAbsolutePath = 'C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client\vpnui.exe'
#****************************************************************************
#**** Please do not modify code below unless you know what you are doing ****
#****************************************************************************
Add-Type -AssemblyName System.Windows.Forms -ErrorAction Stop
#Set foreground window function
#This function is called in VPNConnect
Add-Type @'
using System;
using System.Runtime.InteropServices;
public class Win {
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetForegroundWindow(IntPtr hWnd);
}
'@ -ErrorAction Stop
#quickly start VPN
#This function is called later in the code
Function VPNConnect()
{
Start-Process -FilePath $vpncliAbsolutePath -ArgumentList "connect $CiscoVPNHost"
$counter = 0; $h = 0;
while($counter++ -lt 1000 -and $h -eq 0)
{
sleep -m 10
$h = (Get-Process vpncli).MainWindowHandle
}
#if it takes more than 10 seconds then display message
if($h -eq 0){echo "Could not start VPNUI it takes too long."}
else{[void] [Win]::SetForegroundWindow($h)}
}
#Terminate all vpnui processes.
Get-Process | ForEach-Object {if($_.ProcessName.ToLower() -eq "vpnui")
{$Id = $_.Id; Stop-Process $Id; echo "Process vpnui with id: $Id was stopped"}}
#Terminate all vpncli processes.
Get-Process | ForEach-Object {if($_.ProcessName.ToLower() -eq "vpncli")
{$Id = $_.Id; Stop-Process $Id; echo "Process vpncli with id: $Id was stopped"}}
#Disconnect from VPN
#echo "Trying to terminate remaining vpn connections"
#start-Process -FilePath $vpncliAbsolutePath -ArgumentList 'disconnect' -wait
#Connect to VPN
echo "Connecting to VPN address '$CiscoVPNHost' as user '$Login'."
VPNConnect
sleep -m 3000
#Write login and password
##[System.Windows.Forms.SendKeys]::SendWait("$Confirmation{ENTER}")
#[System.Windows.Forms.SendKeys]::SendWait("$GROUP{ENTER}")
##sleep -m 3000
[System.Windows.Forms.SendKeys]::SendWait("$Login{ENTER}")
sleep -m 3000
[System.Windows.Forms.SendKeys]::SendWait("$Password{ENTER}")
##sleep -m 7000
##[System.Windows.Forms.SendKeys]::SendWait("{TAB} ")
sleep -m 10000
#Start vpnui
start-Process -FilePath $vpnuiAbsolutePath
#Wait for keydown
@advjohn
One of our customers also have issues with Cisco AnyConnect VPN. On some workstations, the credential are not sent properly, which I think is your case also.
He had performed several tests and he mentioned us that on Windows 10 build 1511 and 1607 it's working fine.
The issue occurred on Windows 7 SP1 and Windows 8.1. All OS are 64bit edition.
This same customer provide us access to his VPN so that we can performed some tests to resolve this issue (we are not using this VPN internally, so the troubleshooting was difficult).
I am currently building workstations to try to reproduce the issue internally. I should be able to get you some news about this by the end of next week. Please note that monday our office is closed because of Thanksgiving in Canada.
Best regards,
Jeff Dagenais
Thanks Jean Francois much appreciated. If I can be of assistance I am happy to help. Perhaps I could create a virtual machine from one of my workstations where this isnt working? ANyways let me know if I can help or if you want to do a webex with one of our people to troubleshoot.
John
@advjohn,
I have performed a lot of tests since yesterday with RDM and Cisco AnyConnect.
I have tested Cisco AnyConnect on Windows 7, 8 and Windows 10. Unfortunately, I am not able to reproduce your issue internally. Everytime, the username and/or the password was sent properly to the vpncli.exe.
I had a chat with our engineering department and we may think that the send keys are sent too slow on your Windows 7 computers. I would like you to try 2 things on a Windows 7 computer if possible:
Run RDM as administrator to see if that help
Disable UAC on your Windows 7 computer. Please consult http://superuser.com/questions/83677/disabling-uac-on-windows-7 if needed
Let me know of the results.
Best regards,
Jeff Dagenais
Hi Jean,
We tried both these on a workstation with this issue and neither fixed the issue.
Hello,
Our other customer who was having the same issue on Windows 7 and Windows 8 resolved the issue by enabling the UAC.
Does the UAC was enabled or disabled on your computer? If it was disabled already, could you try to enable it?
Best regards,
Jeff Dagenais
Hello,
We are new to RDM and also face this issue. I'm running a Windows 7 SP1 machine, RDM 12.0.5.0, UAC disabled and Cisco AnyConnect Secure Mobility Client (version 4.3.01095). As soon as the cli jumps to the password input the "wait after execution" countdown starts and the vpncli loses its focus... so no password is entered.
Edit:
I should try before I ask... Enabled UAC and the password gets entered correctly...
Best regards,
Andreas
Hello Andreas,
Thanks for letting us know that is working with UAC enabled.
Best regards,
Jeff Dagenais