Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

task scheduler tasks keep "running"

Status
Not open for further replies.

techseek

MIS
Nov 5, 2010
97
US
Hello
I was having a problem getting to run a .bat (to execute simple powershell script). I finally got it to work
However, now I notice that any task that I run - shows status of "running" even after it does it's job.
The other thing is that I read that a restart of the scheduler srvice may help but - I am unable to do so - the service shows greyed out items?
I am unable to find any fixes for these things
I tried using sc config schedule type= interact (to test)
and i got access denied
Help!
 
There's probably a problem with your scheduled task. Check Task Manager and see if you have abandoned cmd or powershell processes. Set your task to stop if it doesn't complete in 15 minutes or an hour (there are 2 places to set this).

The likely problem is the account running the scheduled task doesn't have enough rights. The "use highest privileges" check box overrides the normal UAC setting.

PSC
[—] CCNP[sub][blue]x3[/blue][/sub] (Security/R&S/Wireless) [•] MCITP: Enterprise Admin [•] MCSE [—]

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --from "Hackers
 
HELLO
thx for your reply
I am logged in and running as (Domain) Administrator. I had tried using the "elevated privileges" and it wasn't working. On the suggestion of a tech post somewhere, I unchecked that setting and then it did execute but I then encountered the unending task situation.
I also think something is wrong with the scheduler task service - most options in properties are greyed out

has anyone encountered this before?

thx
 
Can you specify some fields that are grayed out? I can check on one of my boxes.

Why did you disable the "use elevated privileges" checkbox?

PSC
[—] CCNP[sub][blue]x3[/blue][/sub] (Security/R&S/Wireless) [•] MCITP: Enterprise Admin [•] MCSE [—]

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --from "Hackers
 
Hi
Sorry, it wasn't the "elevated privileges"
that I unchecked - it was the "run whether user is logged on or not"

the task scheduler greyed out options are"
general tab- start/stop/pause/resume
Log on tab - all options for "Log on as"
recovery tab - all options on that tab
on the dependencies tab i am able to see and expand the dependency components
thanks
 
Sorry... We seem to have had a disconnect. I was talking about the tasks themselves, not the service.

[blue]Task Scheduler Service[/blue]
You cannot modify any properties of this service because it is protected by the OS. If you think there is a problem with it, you need to reapply the latest service pack and patches. The tabs you see grayed out, you will find grayed out on every 2008 server.

[blue]Tasks[/blue]
1)For tasks to run correctly, they must have appropriate permissions. On the General tab, make sure that "Run whether user is logged on or not" is selected, and "Run with highest privileges" is selected. If your PS script accesses resources that are not on the local box, then you will need to specify a user account that has access to the remote resources and the local machine.

2)On the Trigger tab, in the properties of your triggering event, there is an option called "Stop task if it runs longer than:". Set it to 30 minutes.

3)On the Settings tab there is a setting called "Stop the task if it runs longer than:". Set it to 1 hour.

Note: I'm not sure why the same setting exists in 2 places or which takes precedence, but I set both just in case.

My last comment would be that you need to verify that your script works in the first place and that it isn't erroring out. Additionally, do not try to run tasks on a DC under 2008, you will be required to modify the "Default Domain Controllers Policy" GPO (Which can get you into security mess of epic proportions very quickly).

PSC
[—] CCNP[sub][blue]x3[/blue][/sub] (Security/R&S/Wireless) [•] MCITP: Enterprise Admin [•] MCSE [—]

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --from "Hackers
 
thanks again for taking the time
About the greyed out tab props on the service itself- i did not know that was so for 08servers.
my script copies a .bak sql file from app server to file server. When i run it from a command prompt it works just fine. Like I said, it also works with the task scheduler but for some reason, after completing, it just shows as "runnnig" until I manually end it. This happens even if I do a simple task with just local resources.
I have the settings on the task you mentioned. What I am wondering now is maybe I specified the local admin account instead of the domain admin - worth a try.
the server is a member server. I will also add the time limit setting.

thanks again
 
Yoou may need to try adding an "EXIT" to the end of the batch file to make it close the command box and return to the schedualer.

David.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top