Windows, client, service: No auto-connect, control via CLI?
Posted: Tue Feb 18, 2014 7:04 pm
I have set up the Windows client OpenVPN point-to-point using the default install, running the GUI program as admin, and without the service, and in general it is working, so no need to debug any of that.
However the end-user experience for using OpenVPN is a mess of "click on this, click on that, click on that other thing, then that thing, then that..."
I want to streamline it down to a single icon that doesn't need administrative rights to use.
What I want:
Start OpenVPN Service, but don't auto-connect anything. Wait for commands to connect/disconnect from non-admin user.
Batch file on desktop when clicked, that does not need admin rights to work:
- Send command to OpenVPN service to start a VPN connection
- Wait for success response
[..... do stuff .....]
- Send command to OpenVPN service to stop VPN connection
- Wait for success response
- Exit
The first part regarding loading the OpenVPN service but not doing anything, I believe I understand that. Just don't put any .ovpn config files in the default location and the service won't do anything when it starts.
However, I don't see any documentation of how to send connect and disconnect commands to the service via the command line from a non-admin user, and to read back status from the service of whether the command completed or failed.
(Full planned process:)
Batch file on desktop when clicked, that does not need admin rights to work:
- Send command to OpenVPN service to start a VPN connection
- Wait for success response
- Map network drives for user
- wait for success response
- Start program that needs the VPN connection
- wait for it to close
- Disconnect the network drives
- Wait for success response
- Send command to OpenVPN service to stop VPN connection
- Wait for success response
- Exit
However the end-user experience for using OpenVPN is a mess of "click on this, click on that, click on that other thing, then that thing, then that..."
I want to streamline it down to a single icon that doesn't need administrative rights to use.
What I want:
Start OpenVPN Service, but don't auto-connect anything. Wait for commands to connect/disconnect from non-admin user.
Batch file on desktop when clicked, that does not need admin rights to work:
- Send command to OpenVPN service to start a VPN connection
- Wait for success response
[..... do stuff .....]
- Send command to OpenVPN service to stop VPN connection
- Wait for success response
- Exit
The first part regarding loading the OpenVPN service but not doing anything, I believe I understand that. Just don't put any .ovpn config files in the default location and the service won't do anything when it starts.
However, I don't see any documentation of how to send connect and disconnect commands to the service via the command line from a non-admin user, and to read back status from the service of whether the command completed or failed.
(Full planned process:)
Batch file on desktop when clicked, that does not need admin rights to work:
- Send command to OpenVPN service to start a VPN connection
- Wait for success response
- Map network drives for user
- wait for success response
- Start program that needs the VPN connection
- wait for it to close
- Disconnect the network drives
- Wait for success response
- Send command to OpenVPN service to stop VPN connection
- Wait for success response
- Exit