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
WPF Storyboard
Grant Permissions to a user for access of everyone's calendar
Cisco exam 642-892 Composite
How do I split .Net 4.0 Windows Form event handlers into separate files?
Select Records in a particular priority
iSCSI Migration Server 2008
Anyway to search a large text file without loading it into memory?
Xp WSUS Gorup Policy not working
T-SQL query question about row_number()
How to set PTR in if your DNS host private IP