Microsoft
Software
Hardware
Network
Question : SQL 2008 Job can't start/stop services
I am trying to get my SQL server to stop and start a local service. For some reason when I run the step type as "Operating system (CmdExec)" I get the following error in the job history...
Executed as user: MyDomain\UserID. System error 5 has occurred. Access is denied. Process Exit Code 2. The step failed.
I have logged in as this user and can start and stop services from the services.msc AND the command line.
I also tried running the same command via Powershell and receive this message...
Executed as user: MyDomain\UserID. The job script encountered the following errors. These errors did not stop the script: A job step received an error at line 1 in a PowerShell script. The corresponding line is 'start-service messenger'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Service 'Messenger (Messenger)' cannot be started due to the following error: Cannot open Messenger service on computer '.'. Cannot open Messenger service on computer '.'. Access is denied '. Process Exit Code 0. The step succeeded.
Again, I can open powershell from within SQL and run the command just fine.
I did find a work around which was to change the SQL Agent service to run as local system. The problem with this is that it is against best practices.
Some info about our environment...
Windows Server 2003 R2 SP2 x64
SQL 2008 Developer Edition SP1 CU5
sqlbiagent is a local admin and sysadmin in SQL
I've tried this on two servers that have the same config and have experienced the same results.
Answer : SQL 2008 Job can't start/stop services
I figured it out. It was an overly secure group policy. I disabled it, rebooted the server and now it runs fine.
Thanks :)
Random Solutions
How do I install VMWare ESXI 3.5 on a Adaptec 5405?
Password Management Solution
leading zeros on int
Batch File - Extract Numbers from a text file
restore script needed for standby
how to monitor traffic on linux interfaces
Duplex print pdf files
TO INSTALL OR NOT -- MOBO DRIVERS
How do I prevent my app from being indexed by search engines
Exporting variables from module on windows