Can I use SA account (disabled) as SQL agent job owner
Question
Friday, February 22, 2019 11:31 AM
Hello,
Please suggest what do I need to ensure to have all my sql agent jobs executing with SA account (disabled) as owner and not have the jobs fail due to permissions issue.
Is there a risk of having any of the job steps fail because my job owner is disabled?
Thanks in advance.
All replies (6)
Friday, February 22, 2019 11:36 AM âś…Answered
Even if SA account is disabled it would work as owner of job and job would not fail. The thing is, IIRC, for owner the job checks if owner is sysadmin, if so it would not perform impersonation and would go ahead and execute the job. You can simply try to create a simple job which runs select * from sys.databases in SQl Server agent make SA as owner, disable it and run the job. The job would work and suceed
Cheers,
Shashank
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
Friday, February 22, 2019 3:21 PM | 1 vote
If the job owner is a sysadmin, there is no impersonation. So, even with "SA" disabled, the job should function normally.
I normally leave the job owner as "SA" (Whether disabled or not) because SA always exists. Generally, the problem of jobs failing due to owners happens when the job owner is dropped which can never happen if the owner is SA. So you should be good.
Please remember to click "Mark as Answer" if my response answered your question or click "Vote as helpful" if it helped you in any way.
Monday, February 25, 2019 9:52 AM
Hi Mounika91,
Yes, you can use the sa as the job owner without error even though the sa account is disabled.
I had a test job with the sa as the owner. Then I disabled the sa account. And the job can still be executed successfully.
Best Regards,
Emily
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com
Wednesday, February 27, 2019 1:33 AM
Hi Mounika91,
You are welcome.
Could you please tell us if you have solved the question. If so, in order to close this thread, please kindly mark helpful replies as answers.
By doing so, it will benefit all community members who are having this similar issue. Your contribution is highly appreciated.
Best Regards,
Emily
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com
Thursday, February 28, 2019 9:43 AM
Thanks for your reply.
My T-SQL jobs (simple backup job) runs fine with SA account disabled.
But, not my SQL agent backup jobs configured using maintenance plans.
I get error :
Executed as user: NT Service\SQLAgent$XXXX . Execute SQL Task Description: Failed to acquire connection "Local server connection". Connection may not be configured correctly or you may not have the right permissions on this connection. he Execute method on the task returned error code 0x80131904 (Login failed for user 'sa'. Reason: The account is disabled.)
Please suggest
Thursday, February 28, 2019 10:10 AM
Please raise a new thread for this question to get better response.
Cheers,
Shashank
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it