0

Problem:
While trying to execute an exe (kept in network path) through Sql Job (type: Operatingsystem(CmdExec)) below error occurred:

Executed as user: NT Service\SQLAgent$SQL2017STD. The process could not be created for step 1 of job 0x584A510A04B6044789C7E0CC6616315A (reason: The system cannot find the file specified). The step failed.

Error occurs if exe is in different pc than the SQL Server on job execution
For example : My SQL Server is hosted in PC1 and my exe is present in PC2, Both PCs are in same network.

So how to run an exe present in a different pc than the server?

Note: we Know this solution which includes configuring xp_cmdshell, but we don't want use that because of security concerns.

Solution which works:
The main application can be executed through an intermediate application which is executed through the Sql job step.
Intermediate application present in the same pc as the Sql server , where as the main application present in different pc.
Both applications run using same sql agent username that is 'Service\SQLAgent$SQLSTD2017' which has default permissions.

but why the Sql agent can't run the main exe directly?

2
  • If you login to the machine of the SQL Server, and try to access the folder path where the exe lives on the other computer, are you able to access it?
    – J.D.
    Apr 1, 2023 at 13:15
  • Yes we can access the exe path manually from the machine where sql server is present, only accessing through job not possible. Apr 4, 2023 at 6:29

1 Answer 1

0

You should create a domain account for your SQL Agent service and set it. Give permission for it and try again.

P.S. I hope you use a SMB share.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.