1
How may I connect to VPN using the username, password and PSK combo in the command line? Google has been of no help; any guidance will be most welcome.
I want a command to the effect of vpnclient /server domain.tld /username u /password p /psk k
if at all possible. (I want to run it as part of a script on multiple systems)
If you're happy to use PowerShell, this page might be useful.
– Bob – 2015-10-10T10:17:54.290Otherwise, it looks like
rasdial
is the legacy command. – Bob – 2015-10-10T10:19:29.2271
Possible duplicate of Change VPN in Windows 7 from command line
– Bob – 2015-10-10T10:20:40.673Further reading: http://blog.cjwdev.co.uk/2011/05/19/automate-creation-of-an-l2tp-vpn-with-pre-shared-key-and-automatically-use-windows-credentials/, http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=2555, http://stackoverflow.com/questions/14614465/establish-a-vpn-connection-in-cmd
– Bob – 2015-10-10T10:21:36.013@Bob I want a command to the effect of
vpnclient /server domain.tld /username u /password p /psk k
if at all possible. (I want to run it as part of a script on multiple systems) Would you happen to know any commands that'll let me do so? – Oxwivi – 2015-10-10T10:24:55.480That's basically what
– Bob – 2015-10-10T10:28:02.773rasdial
does, albeit with an existing connection. Something likerasdial entryname username password
- you might be able to create a portablepbk
file and specify it with/phonebook:phonebookfile
. As for PSK... read the further reading links. You might be able to add it to the phonebook file. You can probably create the entry with the GUI and copy it from%AppData%\Microsoft\Network\Connections\Pbk
@Bob, if you'll put those step-by-step in an answer, I'll accept it. But do add opening the
pbk
file and adding the PSK to the already present line. It isn't saved by default for some reason. – Oxwivi – 2015-10-11T15:48:11.557