auto connect vpn

mike o'reilly
mike o'reilly used Ask the Experts™
on
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

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
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/
Distinguished Expert 2018

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
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Distinguished Expert 2018

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
Distinguished Expert 2018

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.
Top Expert 2013
Commented:
RASdial is intended for use with a Windows VPN client.  I am assuming you are using a product called PureVPN.  If so I do not believe it will work.

With a windows VPN client the format would be:
(Assuming the VPN connection name is Office1}

RASdial   office1  username   password

You may need to add the domain name, if so:
RASdial   office1  username   password   /domain:YourDomainName

If you replace the password with an    *     it will ask you for the password at logon.
Only the password is case sensitive.
By no spaces, they mean no spaces in the user name.  For example a username of  Bob Smith is unacceptable, but  putting it quotes may work such as  "Bob Smith"

As mentioned I am almost certain PurVPN  ( https://www.purevpn.com ) will not work with RASdial. If using PureVPN you would have to ask their support team how to run the program as a service if you want to auto connect.  You may be able to do so with Microsoft's instsrv.exe and srvany.exe, but that can be a frustrating process to get running.
https://support.microsoft.com/en-us/help/137890/how-to-create-a-user-defined-service

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
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
Distinguished Expert 2018

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.
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
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
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!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial