Its DBA’s responsibility to regularly audit sql jobs and make sure there owner is sa.
Below is quick scripts to find job owner fo SQL Server Job
/**************List of Jobs and their owner*************************/
Select s.name as jobname , l.name as jobowner
from msdb..sysjobs s
inner join master.sys.syslogins l
on s.owner_sid = l.sid where l.name = 'sa' order by s.name
/***************************************/
/*************List of Jobs whose owner is sa**************************/
Select s.name as jobname , l.name as jobowner
from msdb..sysjobs s
inner join master.sys.syslogins l
on s.owner_sid = l.sid where l.name = 'sa' order by s.name
/***************************************/
No comments:
Post a Comment