Running a command prompt command remotely

Trying to create a scheduled task on some servers to help with a cert renewal issue, I can't get the command - which works locally - to run in a kaseya procedure.

The command creates a scheduled task and sets some parameters with a xml file. Like I said, works fine running the command from an elevated command prompt locally, but not with the Execute Shell command... i have tried several procedure properties which should i be using for this ?

You have posted to a forum that requires a moderator to approve posts before they are publicly available.

You are running this command as a "system" account via Kaseya and it is unable to access the network path you're specifying (e.g. \\cantsee\cantsee$\SQLCertificate.xml).

If you want to reproduce this for yourself outside of Kaseya, you can grab psexec.exe from Pstools and run 'psexec -s cmd.exe' via the command-line. This will get you a fully interactive command shell running as the System account and you should see that if you run your schtasks command, it will fail out with 'network path not found'.

The solution here is to use an 'Impersonate User' step just before your Execute Shell Command step. You'll probably want to enter a domain admin account here with the ability to authenticate to your target network share.

In your Execute Shell step, you'll want to switch it to execute as User as opposed to System. The user in this case will be the previous account you have specified with your Impersonate User step.

You have posted to a forum that requires a moderator to approve posts before they are publicly available.

I attempted to use Impersonate user as well and did it incorrectly prior to your instruction, I used my account (knowing though testing that my creds would run it successfully) and confirmed that you are in fact correct. Worked like a champ after following your suggestion, you sir may pass go and collect 200 dollars. Thank you!

You have posted to a forum that requires a moderator to approve posts before they are publicly available.