Answer the question
In order to leave comments, you need to log in
Running service restart script with Task Scheduler?
Hello, I am in a difficult position.
I have machines with Windows 7 that connect via OPEN VPN, the gateway has Fail Over, if the first operator falls, Mikrotik will change to another one. The script checks the availability of the first gateway every 10 minutes, if it is not available, replaces the config file with a backup one, everything is fine, but there is one problem, in order for the config to take effect, you need to restart the OpenVPN service. Introduced into the service a command to stop start via net, but if the script is launched by the task scheduler, then Access is denied, and if the script is run manually, then everything works.
On computers, only the local administrator and the scheduler runs the script on behalf of the administrator.
I will be glad for any help.
The script itself
Answer the question
In order to leave comments, you need to log in
Kill it. OpenVPN knows how to HA/failover itself: https://openvpn.net/community-resources/implementi...
Try to run as system. In general, look on the Internet for articles on how to bypass UAC using the task scheduler and there will be exactly the knowledge you need in the output.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question