Auto Start VPN when windows 10 starts

Hi,

I have a windows 10 Pro laptop that has a VPN connection to a remote 2008R2 server. The VPN works fine but rather than manually start the connection each time I boot my Laptop I would like it to auto start.

I've tried using Windows Task Scheduler and rasdial as described in this article but it's failing to start the connection.

It may be that the article is for Windows 7 and I'm using Windows 10 but I'm not sure, any help appreciated.

Thanks
DavidBurchettAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

McKnifeCommented:
We don't know how you start the connection - do you just double click an icon (=shortcut)? If so, put that shortcut into the autostart folder. Find autostart like this:
-press winkey together with r [a run box appears]
-now enter shell:startup [and press enter :)]
A folder will appear, put it inside.
0
DavidBurchettAuthor Commented:
Hi McKnife,

I did look at that option but the connection is not a shortcut in Windows 10 but a menu (of sorts) on the VPN section of the Network & Internet page within the Windows 10 settings section.

Cheers
David
0
McKnifeCommented:
Ok, is that menu listed if you go to
winkey+r
ncpa.cpL
?
If so, can you rightclick-drag it from there to that startup folder I mentioned?
0
MSSPs - Are you paying too much?

WEBINAR: Managed security service providers often deploy & manage products from a variety of solution vendors. But is this really the best approach when it comes to saving time AND money? Join us on Aug. 15th to learn how you can improve your total cost of ownership today!

DavidBurchettAuthor Commented:
Yep it was the same menu so I added the shortcut to the startup folder and rebooted but it only loads the "Network & Internet" page with the VPN option highlighted ready to click the "Connect" button. We're halfway there I guess but I really need it to auto connect without having to click any buttons.
0
McKnifeCommented:
For me it works the following way:
task scheduler action: rasdial "vpn connection"
"run only when the user is logged on"
"run with highest privileges" NOT checked
0
DavidBurchettAuthor Commented:
I made changes:

task scheduler action: rasdial "vpn connection" - My connection name has no spaces so not using quotes I had my VPN username and password in the arguments field so I removed them leaving just the VPN name.
I had "Run whether user is logged on or not" so I changed it to "run only when the user is logged on"
I had "run with highest privileges" checked so I unchecked it.

If I click the "Run" button for this "Selected Item" it does run the task and the VPN connects. The DOS window opens and I can see the authentication and connection happen in real time. I had to add my username and password back in to the rasdial argument to get it to work using the "Run" button

If I restart or shut down and cold boot the laptop then task manager will not run this task.
0
McKnifeCommented:
Sure, we forgot to set a trigger :)
Trigger: At logon.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DavidBurchettAuthor Commented:
My Trigger is "At System Startup" should I change it?
0
McKnifeCommented:
You should.
0
DavidBurchettAuthor Commented:
That fixed it!

I used "At System Startup" as my original trigger as I wanted the VPN to pre connect by the time my login script had finished but the delay using "At login" is unnoticable so I'm a happy camper :-)

Worth noting the VPN username and password does have to be present.

Many thanks
0
McKnifeCommented:
You're welcome.
0
DexterITCommented:
Legendary. Thanks Guys.  I have a (very) remote office too and just had to ship a new PC there after a lightning strike.  Didn't have time to ship the PC to me first for Domain setup as I previously have, so this one has to run with a local login.
I used scheduler to activate the VPN connection at logon using the instructions above which happens really quickly.
My only uncertainty was in the arguments box as my VPN has a worst practice name (with spaces), but my first effort worked with:
run program : C:\Windows\System32\rasdial.exe
Arguments: "MyDumbass VPN Connection Name" username Pa55word

I then scheduled another task at logon with the "delay for 15 seconds" option which runs a local copy of the domain-users start-up script to mount all the remote drives the user needs.  Runs like a dream.

Thanks for the pointer.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 10

From novice to tech pro — start learning today.