We help IT Professionals succeed at work.

auto connect vpn

mike o'reilly
on
327 Views
Last Modified: 2017-04-17
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
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2013

Commented:
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/
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Please be clear about the details, "usernamepassword no spaces" - is not understandable.

Author

Commented:
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
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
"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.

Author

Commented:
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
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Look, make screenshots of what you have and upload them - we will see clearer, then.

Author

Commented:
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.
CERTIFIED EXPERT
Top Expert 2013
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
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
CERTIFIED EXPERT
Top Expert 2013

Commented:
Will it start manually for other users?

Author

Commented:
cant see it in the task manager nor listed in active tasks
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
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.
CERTIFIED EXPERT
Top Expert 2013

Commented:
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.

Author

Commented:
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
CERTIFIED EXPERT
Top Expert 2013

Commented:
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.

Author

Commented:
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
CERTIFIED EXPERT
Top Expert 2013

Commented:
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!

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions