Thursday, July 1, 2010

Access Denied in SQL Agent CmdExec Job Step

Trying to run a SQL Server Agent job that has an Operating System Command (CmdExec) job step running under a proxy account. If you're getting the following message you might need to check the permissions on the executable or batch file for the SQL Agent service account.

Here is the messages:
Executed as user: /. The process could not be created for step 1 of job 0xB05ED7277CA4354FAEFD1E6285B635A3 (reason: The system cannot find the file specified).  The step failed.

It turns out that the SQL Agent account has to have permission to the file so that it can effectively run it under a "runas" command (I guess).