Server 2012 R2 Run Program from Task Scheduler not running program

scheduled-taskwindows-server-2012-r2

I have a scheduled task that I am trying to run a program (a DB backup program). For reasons unknown I am unable to actually get the program to run, even though the task log says everything was run complete on schedule.

What am I doing wrong? I've changed settings, used a UNC path to the program, tried different admin accounts, used the NETWORK SERVICE account. No success. Seems like it has to do with security permissions to run the program, but I can't solve it.

Can someone help figure out how to run this program from Task Scheduler? Thank you!

-OS: Server 2012 R2
-If I run the task while logged in (manually or on schedule while logged in), everything runs fine.
-The DB Backup Program has a log, but nothing in the log states anything even started when the task runs logged out.
-The DB Backup Program does not have a UI.
-The DB Back Program is intended to be run by the task scheduler and is run by other users around country successfully.
-The user set to run the task is a admin with full admin credentials. The task was also attempted to be run by the local built-in admin with no result.
-The program, folder and parent folders all allow permission to the admin group.

General:
User: Admin Account
Run whether user is logged on or not
Run with highest privilages
Configure for: Vista, Server 2008
Triggers:
Daily, 3am, Enabled
Actions:
Start a program: "C:\Program Files (x86)\Rock Gym Pro\Backup.exe"
Conditions:
Start the task only if the computer is on AC Power
Stop if the computer switches to batter power
Settings:
Allow the task to be run on demand
Stop if the task runs longer than 3 days
If the running task does not end when requested, force it to stop
History:
3:00AM – Task Scheduler launch task "\RGP Backup" , instance "C:\Program Files (x86)\Rock Gym Pro\Backup.exe" with process ID 3496.
3:00AM – Task Scheduler started "{206e1cd6-db27-49f7-b143-ca1228f59c74}" instance of the "\RGP Backup" task for user "DOMAIN\Admin".
3:00AM – Task Scheduler launched action "C:\Program Files (x86)\Rock Gym Pro\Backup.exe" in instance "{206e1cd6-db27-49f7-b143-ca1228f59c74}" of task "\RGP Backup".
3:00AM – Task Scheduler successfully completed task "\RGP Backup" , instance "{206e1cd6-db27-49f7-b143-ca1228f59c74}" , action "C:\Program Files (x86)\Rock Gym Pro\Backup.exe" with return code 0.
3:00AM – Task Scheduler successfully finished "{206e1cd6-db27-49f7-b143-ca1228f59c74}" instance of the "\RGP Backup" task for user "DOMAIN\Admin".

Best Answer

i´ve been trying hard to make similar software run OK when you choose:

Run whether user is logged on or not

It resulted with 2 different software (SyncBack and synctoy) that the problems were in both cases third party soft related problems (not soft problems but things to take into account).

As an example, if you created a Task to run:

"C:\Program Files (x86)\Rock Gym Pro\Backup.exe"

as domain\user1 , With some parameters lik -R "MyBackup", but you configured the task from another user like domain\administrator,

and also set "parameters like -R "MyBackup"" as administrator, software creates "MyBackup" config file under administrator folders (usr/administrator/appdata/roaming/...), so when the task executes as doman\user1 , the program search for "Mybackup" config file in user1 folder.

As result, no file exist in user1 appdata or whatever folders, because you never configured the software from user1, so nothing happen.

To solve this, you have to logon as that user, in the server, in order the folders be created, test the script from that user (If you want with scheduled task, with the "Run whether user is logged on or not" option activated,), and then you configure the task from administrator user and then set to run as user1. That way when task run the software will find the "MyBackup" files and execute with no problem.

That was my problem, hard to find because there weren´t logs of this anywhere (or i couldn´t find them), just nothing happened when you run the task and finally says "Task Executed Successfuly".

Please let me know if i helped...Sorry my english im from Argentina.