Link to home
Start Free TrialLog in
Avatar of mike o'reilly
mike o'reilly

asked on

auto connect vpn

I have been messing with this for ages  I have vpn up and running all good   set up task sch.  but no connect I can see the task trying to connect so I have a setting wrong somewhere,  can anyone go through the set up exactly for me on task scheduler- some say rasdial.exe some say system 32 or programs     on windows10pro please help it should be quite simple but wont start   my setting in task scheduler are name vpn connection configure for W10    trigger  connect at log on wait 10 secs    action start a program  C:\Windows\System32\rasdial.exe  arguments "purevpn"usernamepassword no spaces    start only if my local network is available    settings allow to run on demand   and do not start a new instance
Avatar of Rob Williams
Rob Williams
Flag of Canada image

I did a blog article a while back on automating with RASdial which  may be of some help:
https://blog.lan-tech.ca/2013/06/08/rasdial-automate-vpn-connections/

If the device is domain joined the following is a better option:
https://blog.lan-tech.ca/2012/04/29/connect-to-windows-vpn-at-logon/
Please be clear about the details, "usernamepassword no spaces" - is not understandable.
Avatar of mike o'reilly
mike o'reilly

ASKER

usernamepassword  is it really no spaces or quotes.  I am thinking this needs to be entered in a specific way and this is where I am going wrong how do I enter this in the argument in the correct way
"run only when the user is logged on" needs to be checked. Then, no password will be asked for. As username, take your own user's name.
I move the connection name into the arguments box and now it is asking for pass and user I notice Mr Burchette also said he had to put it in at the last.   it sounds right to me,  even if I am logged in I still have to enter these to connect, even though this is actually done automatically if you tick remember my details in the set up   I have tried   [/Uooooooooo[/Pooooooo]]  and various others but I cant get this syntax right
Look, make screenshots of what you have and upload them - we will see clearer, then.
I need to know the exact correct layout to put username and password in the arguments box.  I have asked several people this and get a different answer every time.
ASKER CERTIFIED SOLUTION
Avatar of Rob Williams
Rob Williams
Flag of Canada image

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
thank you ROB that was all I needed it is now working fine.
 Now can you further help me with the fact that it wont start on second user,, trigger is set to any user at log on oddly enough this was why I removed the app in the first place that would not auto connect second user either
Will it start manually for other users?
cant see it in the task manager nor listed in active tasks
Mike, 2 days ago you said, you saw my solution in the other thread and you would like to use it, but you fail. I ask you to show a screenshot of your settings, again. The thread has another comment at the end where someone writes
run program : C:\Windows\System32\rasdial.exe
Arguments: "MyDumbass VPN Connection Name" username Pa55word
is what he used successfully.
I was asking if the user can manually start the VPN connection.  If not it is a problem with the install of the VPN service and possibly profile.  If they can it is a problem with the scheduled task.
No not really Rob Williams sorted it out for me it was just the clarity of how to enter the user and pass in the arguments once I put in the spaces it worked, (boy people talk some rubbish about how to do this on other sites)  except that is for second user. could not get this to work on any user group.  I found the easiest way around this was to create a second task for the other user.  this has done the trick both users run at log on now.  
I am no expert by any means but this does the job..
So can you see any problems with that
Capture.PNG-4.PNG
Capture.PNG-5.PNG
Capture.PNG-06.PNG
More often it is applied using a batch file in the all users start menu than a task.  It is shown it the link I provided in my first comment.
Glad to hear it is working.
thank you for your support guys and let me apologise for my slow response (mother ill ) and spend a lot of time out of connection range
I found no problem setting up a task but could not get this entry layout correct due to bad advice from other sites. I understand that you could not understand, what I was actually asking. I was glad to know that I was at least right and the user and pas was the problem.

thanks again all working now
Mike
Thanks Mike.  Glad to hear it is working.  Hope you mother recovers soon.  Family comes first.

Are you using PureVPN?  I didn't know RASdial would work with a 3rd party app.  If so good to know.
Cheers!