When you run a SQL Server Agent job that uses a linked
server and the owner of the job is not a system administrator account, the job
may fail and SQL Server displays the following error message:
Remote access not allowed for Windows NT user activated by
SETUSER. [SQLSTATE 42000] (Error 7410). The step
When you run a SQL Server Agent job that is not owned by a
system administrator account, SQL Server Agent runs SETUSER to impersonate the
owner of the job.
If the job uses linked servers, the job may fail
because remote access is not allowed after the execution of
To work around this problem, use one of the following
Make the system administrator the owner of the job.
Use mapped security context for the linked server and modify the
job to run as OSQL.
To set the mapped security context for the linked
- Right-click the linked server, and then click
- Click the Security tab.
- Select either of the following options.
- Be made using the login's current security
- Be made using this security
To modify the job to run as OSQL:
- Right-click the job, and then click
- In the Steps tab, click the
Step Name that you want to edit, and then click
- On the General tab of the Edit Job
Step dialog box, click Operating System Command
(CmdExec) in the Type list.
- In the Command text box, type
osql –E –Q “Exec storeProc”.
- In the Edit Job Step dialog box, click
- In the Properties dialog box, click
behavior is by design.
For more information, visit the following Microsoft Web