1

I am running Windows 2008 Server and I have set up a scheduled task that executes a SQL script from the command prompt. The script and command work completely fine.

I set this scheduled task to run once a day, under the Administrator user account and it has been working fine for over a week. I now want to disable the Administrator account and run the scheduled task as another user (with exactly the same privileges i.e. Users, Administrators).

When I change the user for the scheduled task and try to run it. The Task Scheduler tells me that the task has run (Last run result: 0x0) but the script has not been executed.

Scheduled Task information

  • Run whether user is logged in or not (true)
  • Run with highest privileges (true)

tl;dr Changing an already working scheduled task running under Administrator to another user account stops the scheduled task working (user has same role/privileges).

1 Answer 1

0

The problem was that even though the user had Administrator privileges on the Windows Server it did not have sysadmin or dbo privileges on the SQL server DB/instance. By giving my user these privileges on SQL Server the script executed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .