I'm currently trying to run a SQL Server Agent Job that executes a CmdExec job step under a specific domain account. We've set up the job so that, when deployed, it sets up the following:
- Create a Credential
DOMAIN\CustomUserwith the correct password - Create a SQL Server Agent Proxy
DOMAIN\CustomUser - Grant access to the
Operating System (CmdExec)subsystem for theDOMAIN\CustomUserproxy - Create a SQL Server Agent Job owned by
sa CmdExecJob Step in the above job that runs under theDOMAIN\CustomUserproxy account
The job has been identically deployed (same parameters for all the accounts, passwords, job names, etc.) in two separate environments with different results on three machines.
- SQL Server 2008 R2 SP2 + SQL Server Agent Service running as
LocalSystem- The job runs correctly under this environment for all machines
- SQL Server 2012 SP2 + SQL Server Agent Service running as
DOMAIN\ServiceAccount. TheDOMAIN\ServiceAccountis asysadminin SQL Server and is in theAdminstratorsgroup on the machines.- The job fails two two different error messages on two computers in this environment
On one machine in Environment #2 we receive the following error:
Executed as user: DOMAIN\CustomUser. The process could not be created for step 1 of job 0x657C6E86850D684D9238816B8548D63B (reason: A required privilege is not held by the client). The step failed.
On a separate machine in Environment #2 we receive the following error:
Unable to start execution of step 1 (reason: Error authenticating proxy DOMAIN\CustomUser, system error: The user name or password is incorrect.). The step failed.
I've tried following the guidance here which suggests you need to use SQL Server Configuration Manager to set the service account. No luck with it though.
Disclaimer: I did not configure the machines in Environment #2 so I have no idea if my predecessors did something different when they configured the machines.
Why would I get three separate results (two failures, one success)? The scripted job is bit-for-bit (short of the Job ID) identical across all our machines but it completely fails to run in Environment #2.
LocalSystemfor the agent service) but not on our two other environments. - Mike Bailey