I have upgraded a database to SQL 2017. A SQL Agent Job that previously ran now fails with this error:
Unable to start execution of step 1 (reason: JobOwner DOMAIN\USERNAME doesn't have permissions to use proxy 4 for subsystem PowerShell). The step failed.
This job ran before the upgrade, so I'm confused why permissions would have changed. But no matter, I grant permissions with this script:
USE msdb GO EXEC dbo.sp_grant_login_to_proxy @login_name = N'DOMAIN\USERNAME', @proxy_id = 6 GO
Which then reminds me that the user in question is an admin, and can be neither granted nor denied anything:
'DOMAIN\USERNAME' is a member of sysadmin server role and cannot be granted to or revoked from the proxy. Members of sysadmin server role are allowed to use any proxy.
So what am I missing? How can I fix this, or where should I look to determine what the underlying problem is?
select * from msdb.dbo.sysproxies.