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
VPNCMD.exe connect to server with password
-
- Posts: 2
- Joined: Tue Apr 18, 2017 3:54 pm
Re: VPNCMD.exe connect to server with password
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
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