Possibility to join OVPN when user is not logged on

1

I am trying to achieve an automation for SQL server agent to store backups in a remote computer, but sql server agent has first to join OVPN.

I have tried all the methods described here, but in my case user is not necessarily logged on to start a GUI. Is there a possibility to join to OVPN without GUI.

Andrius V.

Posted 2018-06-20T12:33:33.393

Reputation: 13

Answers

0

Start OpenVPN without a GUI

You can install and run OpenVPN as a Service with the configurations setup for your needs but set its Startup type to be manual so it does not auto start on its own at boot up, etc.

  • Command to ensure OpenVPN Service does not Auto-Start

    SC CONFIG "OpenVPN Service" START= manual
    

You can then have your automation job execute a batch script or if needed trigger a scheduled task that has elevated permissions to start that service to establish the VPN tunnel without the GUI.

  • Command to the Start OpenVPN Service

    NET START "OpenVPN Service"
    

Once the SQL Agent backup job completes successfully and the VPN tunnel is no longer needed, you can then have it stop the service to disconnect from the VPN tunnel.

  • Command to the Stop OpenVPN Service

    NET STOP /Y "OpenVPN Service"
    

Further Resources

Pimp Juice IT

Posted 2018-06-20T12:33:33.393

Reputation: 29 425