Skip to main content
< All Topics
Print

Wrong agent job owner

When creating a SQL Server agent job, the default owner of the job will be the person creating the job. If that person leaves the company and the AD account is disabled, the agent job will stop working. It is advised to set the agent job owner to the sa account.

To query the Performance Store database for wrong agent job owners, use:

select a.*
from dbo.v_agent_jobs a
inner join dbo.v_servers s on s.server_name = a.server_name
where a.owner_sid != 0x01
and a.category_name != 'Report Server'
and a.category_name not like 'REPL-%'
and a.owner_name not like '##MS_%'

The alert will be visible on the Latest stats dashboard.

To exclude specific servers from this alert, see how to use the dbo.team_alert_exclude table in Alerting.

Table of Contents