Error starting a scheduled SQL 2008R2 Agent Job
When I tried to run the job that was created from a maintenance plan in SQL server 2008 R2, the job failed and gives the following message:
 SQLServer Error: 15404, Could not obtain information about Windows NT group/user ‘DOMAIN\SYS_USER_NAME’, error code 0×5. [SQLSTATE 42000] (ConnIsLoginSysAdmin)
I did use Windows Autheniciaton mode and the Sys account that runs the job is set as sysadmin, setadmin, processadmin in the SQL server roles. The SQL agent services is using LOCALSYSTEM to run.
I figured out that the problem occurs because the SQL server is in DOMAIN A and the Sys user is from DOMAIN B. There isn’t a both ways thrust between the two domains, so the DC in DOMAIN B doesn’t allow DOMAIN A to query for the user information.
I solved this issue by running the SQL Agent with a Sys account from DOMAIN B that has “Log on as a service” permissions and the correct SQL permissions instead of the LOCALSYSTEM account.