I am running into an issue with the task scheduler service and I have found that restarting the Task Scheduler service should do the trick in fixing my problem. Unfortunately, I do not have the option in services.msc (as Administrator) to stop, start, or restart the service as the options are greyed out. I have also attempted to use both the "net" and "sc" utilities to stop and start the "SCHEDULE" service, but I keep getting an "Access Denied" error when I try to stop it. I really need to restart this service but I cannot bring down the machine today as it is a workday.
The server's OS is Windows SBS 2011 Essentials. Thanks in advance for any help in the matter.
I guess I could restart the service by finding the process ID on the service and killing it. This causes the service to go to a "Stopped" state. Then I used SC command (probably net start will work too) to start it successfully.
Some points to consider:
Since the service is hosted by "svchost" process, killing the process will bring down many other services (in my case 11 services overall) all in the same time.
This is more of a forceful stop situation, not a graceful stop. So if the services are in the middle of something, they won't probably be happy.
After starting the task scheduler service, I was looking for the rest of the services to start, but I saw that all of those 11 services came back after a few seconds. So you don't need to worry about starting all of the services. (Although it might not be your case, better to be careful with system services)
I still don't know if I've caused any problems in my box, but everything seems to be fine.
As mentioned by HopelessN00b you will need to run the NET and SC commands from an Elevated Command Prompt.
Elevated Command Prompt
I restarted SQL and an Exchange Database Store earlier on our SBS2011, also testing SC STOP SCHEDULE successfully.
SC STOP SCHEDULE
You cant exactly restart it even as admin, you the service is running under the system account.
Are there issues running Scheduled Tasks in Windows 2003 when the task has a GUI? I have one that worked fine in Windows 2000 but won't run on Windows 2003.
I have a .bat job that ran every hour throughout the day on an old Windows 2000 server for many years. I finally retired that server last week and moved the job (and associated programs and files) to a Windows 2003 server.
The .bat file calls a couple cmd line apps first, but the final step is a GUI based .NET app (it does some OCR on image files and then shuts itself down).
From the new server, logged on as the Scheduled Task owner I can run the .bat file from the command line successfully.
From the new server, again logged on as the Scheduled Task owner, I can right-click on the task in the Scheduler and run it successfully. This task simply runs that same .bat file.
If the Scheduled Task owner is logged on to the 2003 server and the task is started from a remote server (where the user started Scheduled Tasks and connected to this server) it'll also run successfully.
If the scheduled task owner is not logged on to this server then the scheduled task fails at the step where the GUI app is launched. We can't get any error messages. Running ProcMon from a different session/user account monitoring that user account didn't turn up anything either.
For the moment, my horrible work-around is to leave the scheduled task owner logged on at the console with the screen locked. Of course, this becomes a pain each time that server is rebooted...
The scheduled task owner is our "domain service account" and is working with all other tasks on all other servers. It isn't locked out or anything like that.
I even tried modifying the Task Scheduler to check the "Allow service to interact with desktop box" but that didn't change anything. (Yes, I restarted the service after the change.)
I need to clarify a bit: The .NET app I mentioned does a bunch of stuff that works. It isn't until it gets to the point where it needs to open a window that the app then hangs. We can see the progress of the app via the logging entries it leaves behind so we can see it working fine with the last log entry being "about to start OCR"... and that's where she hangs.
Do you have access to the source code for the program for debugging? It sounds like the windows creation is failing because there's no windows desktop available to the program unless the task owner is logged into the machine. This article http://msdn.microsoft.com/en-us/library/ms687105%28VS.85%29.aspx describes the process for window station and desktop creation.
Is the task setup to start in a specific directory? Permissions are setup correctly in those directories that it is reading/writing to..
I'm assuming the "Run As' in the task is setup correctly (gotta check basics! :) )
Have you checked to ensure that the account is running the task is granted the right to "Log on as a batch job"
(Local Security Policy\Local Policies\User Rights Assignments\Log on as a batch job)