VPNCMD.exe connect to server with password

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
major4579
Posts: 2
Joined: Tue Apr 18, 2017 3:54 pm

VPNCMD.exe connect to server with password

Post by major4579 » Wed Apr 26, 2017 4:21 pm

I'm having a problem figuring out how to write a script using VPNCMD to connect to a Softether server with a password.
If I use certificates then the following line works fine:

vpncmd.exe /CLIENT localhost /CMD AccountConnect Server-VPN-Name

But for passwords I would like the script to request the password first and then provide it along with the connect command above. How do I use vpncmd.exe to provide a password when connecting? I've looked at the documentation but it is not clear to me what I should do.

BTW this is in Win 7 Pro.

Using the SoftEtherGUI works fine, I can enter the password and it connects - but I'd really prefer that my users NOT see the GUI - especially since they could save the password for next time. I want them to always have to enter their password.

Thanks,
Marc

major4579
Posts: 2
Joined: Tue Apr 18, 2017 3:54 pm

Re: VPNCMD.exe connect to server with password

Post by major4579 » Tue May 02, 2017 11:28 pm

This is what I'm doing but it seems awkward:

Get password into variable $password, then run the following commands:

; Set the password
vpncmd.exe /CLIENT localhost /CMD AccountPasswordSet Server-VPN-Name /password:$password /type:standard
; Connect
vpncmd.exe /CLIENT localhost /CMD AccountConnect Server-VPN-Name
; Clear the password
vpncmd.exe /CLIENT localhost /CMD AccountPasswordSet Server-VPN-Name /password:"" /type:standard

I know this can all be put into a text file and then use the /IN: command line parameter.
What I don't like is setting the password and then having to clear it. Is there a way to enter the password so it will not be retained, and thus be more secure.

Thanks,
Marc

Post Reply