On a Windows machine, I have a script that starts a Linux server, performs a backup, and finally shuts down the server. The script uses Plink with public key authentication to run the shutdown command on the server. The private key is supplied by Pageant.
Shutting down the server does not work if I have the Windows task scheduler run the script. I guess, there is some kind of sandbox that prevents the script from using the Pageant agent.
Is there a way to access the private key from within a scheduled task? Any suggestions for an alternative approach?