Connect to VPN from command line?

S

Samuel R. Neff

How can I establish a VPN connection using saved credentials via the
command line?

Searches on the web point to rasdial but I'm having trouble using the
credentials stored with the connections. If I point rasdial to the
"all users" phone book I get this error:

Remote Access error 691 - Access was denied because the username
and/or password was invalid on the domain.

and if I point it to my personal phonebook I get this error:

Remote Access error 623 - The system could not find the phone book
entry for this connection.

Iif I create a .lnk shortcut to the connection, I can launch it
through windows explorer only--if I launch it through the command line
doesn't seem to do anything--no error, but doesn't connect to the vpn.

Please help.

Thanks,

Sam
 
P

Pegasus \(MVP\)

Samuel R. Neff said:
How can I establish a VPN connection using saved credentials via the
command line?

Searches on the web point to rasdial but I'm having trouble using the
credentials stored with the connections. If I point rasdial to the
"all users" phone book I get this error:

Remote Access error 691 - Access was denied because the username
and/or password was invalid on the domain.

and if I point it to my personal phonebook I get this error:

Remote Access error 623 - The system could not find the phone book
entry for this connection.

Iif I create a .lnk shortcut to the connection, I can launch it
through windows explorer only--if I launch it through the command line
doesn't seem to do anything--no error, but doesn't connect to the vpn.

Please help.

Thanks,

Sam

The usual way is to type rasdial.exe /? at the Command Prompt.
It gives you these instructions:
=====================
USAGE:
rasdial entryname [username [password|*]] [/DOMAIN:domain]
[/PHONE:phonenumber] [/CALLBACK:callbacknumber]
[/PHONEBOOK:phonebookfile] [/PREFIXSUFFIX]

rasdial [entryname] /DISCONNECT
=====================
Hence a command such as this one would work nicely:

rasdial SamVPN Sam SomePassword /phonebook:c:\rasphone.pbk

There is, of course, a big security risk in placing a password into a
script file.
 
S

Samuel R. Neff

Yes, as I said in the original message, I want to use the saved
credentials as if I'd launched the link directly. I don't want to
copy credentials to the batch file.

Please help.

Thanks,

Sam


The usual way is to type rasdial.exe /? at the Command Prompt.
It gives you these instructions:
=====================
USAGE:
rasdial entryname [username [password|*]] [/DOMAIN:domain]
[/PHONE:phonenumber] [/CALLBACK:callbacknumber]
[/PHONEBOOK:phonebookfile] [/PREFIXSUFFIX]

rasdial [entryname] /DISCONNECT
=====================
Hence a command such as this one would work nicely:

rasdial SamVPN Sam SomePassword /phonebook:c:\rasphone.pbk

There is, of course, a big security risk in placing a password into a
script file.
 
S

Samuel R. Neff

How can we launch a VPN connection via the command line without
embedding the username and password in the command line, i.e., using
the saved credentials just as if you'd launched the connection through
Network Connections?

With Rasdial when specifying the all-users phonebook I get this error:

Remote Access error 691 - Access was denied because the username
and/or password was invalid on the domain.

and if I point it to my personal phonebook I get this error:

Remote Access error 623 - The system could not find the phone book
entry for this connection.

Iif I create a .lnk shortcut to the connection, I can launch it
through windows explorer only--if I launch it through the command line
doesn't seem to do anything--no error, but doesn't connect to the vpn.

Please help.

Thanks,

Sam
 
P

Pegasus \(MVP\)

Samuel R. Neff said:
How can we launch a VPN connection via the command line without
embedding the username and password in the command line, i.e., using
the saved credentials just as if you'd launched the connection through
Network Connections?

With Rasdial when specifying the all-users phonebook I get this error:

Remote Access error 691 - Access was denied because the username
and/or password was invalid on the domain.

and if I point it to my personal phonebook I get this error:

Remote Access error 623 - The system could not find the phone book
entry for this connection.

You must first create the connection from the interactive
facility within Control Panel / Network Connections.
After you do, have a look in the phone book. It's a text
file and you can open it with any text editor. Be a little
inquisitive!
 
S

Samuel R. Neff

Yes, the phone book is an INI file with lots of info about the
connection. The username and passwrod are not there and I don't see
how knowing what is in the pbk file helps with the original problem..
how do I actually dial the vpn connection without putting username and
password in the command line?

As I said I can run rasdial and get different error messages depending
on whether I specify the "all" vs "personal" phonebook (the connection
info is in the all phonebook) but I can't get it to connect without
specifying username and password in the command line (even though it
is stored with the connection--although obviously not in the pbk
file).

Thanks,

Sam
 
P

Pegasus \(MVP\)

Here is what I quoted in my first reply for the rasdial syntax:

USAGE:
rasdial entryname [username [password|*]] [/DOMAIN:domain]
[/PHONE:phonenumber] [/CALLBACK:callbacknumber]
[/PHONEBOOK:phonebookfile] [/PREFIXSUFFIX]

rasdial [entryname] /DISCONNECT

Unless I'm seeing things, it has both the user name and the password
as a parameter. The phonebook is there too!
 
S

Samuel R. Neff

Yes, and again from my original question, how can I make the call
WITHOUT embedding username and password in the command line?

Windows Explorer can launch a network connection using saved
credentials.. I want to do the same thing from a command line.

Thanks for trying to help, I'm sorry that we have such a disconnect in
my question and your answers.

Sam


Here is what I quoted in my first reply for the rasdial syntax:

USAGE:
rasdial entryname [username [password|*]] [/DOMAIN:domain]
[/PHONE:phonenumber] [/CALLBACK:callbacknumber]
[/PHONEBOOK:phonebookfile] [/PREFIXSUFFIX]

rasdial [entryname] /DISCONNECT

Unless I'm seeing things, it has both the user name and the password
as a parameter. The phonebook is there too!


Samuel R. Neff said:
Yes, the phone book is an INI file with lots of info about the
connection. The username and passwrod are not there and I don't see
how knowing what is in the pbk file helps with the original problem..
how do I actually dial the vpn connection without putting username and
password in the command line?

As I said I can run rasdial and get different error messages depending
on whether I specify the "all" vs "personal" phonebook (the connection
info is in the all phonebook) but I can't get it to connect without
specifying username and password in the command line (even though it
is stored with the connection--although obviously not in the pbk
file).

Thanks,

Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top