http://www.sqlservercentral.com/blogs/mssqlfun/2013/01/11/under-which-user-your-sql-agent-job-run-sql-agent-service-account-or-sql-agent-job-owner-/

Printed 2014/10/22 08:29AM

Under which user your SQL Agent Job run : SQL Agent Service Account or SQL Agent Job Owner ?

2013/01/11

Today, I am willing to do demo that under which user my SQL Agent Job run, SQL Agent Service Account or SQL Agent Job Owner ?

Normally, We think its SQL Agent Service account user under which SQL jobs runs. But it’s not true in all cases, It depend on your Job owner permissions.

If the job owner is an account that is in the sysadmin fixed server role, than your step of job will be executed under the SQL Agent Service Account.

Otherwise, It will be executed by the account set as the job owner, no matter who is starting the job.

Exception : The job step is a CmdExec or ActiveXScript job step

If the job owner is an account that is in the sysadmin fixed server role, than your step of job will be executed under the SQL Agent Service Account.

Otherwise the step of job will be executed under the security account of the Proxy Account if enabled and configured.

If that proxy account is not configured the step will fail with Below Error.

Non-SysAdmins have been denied permission to run CmdExec job steps without a proxy account. The step failed.

Test Job run under SQL Agent Service account when Job owner is ‘sa’

Test Job run under Job Owner ‘test’ user when Job owner is ‘test’ (non –sysadmin account)

Reference : Rohit Garg (http://mssqlfun.com/)



Copyright © 2002-2014 Simple Talk Publishing. All Rights Reserved. Privacy Policy. Terms of Use. Report Abuse.