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?