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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

weird issues with TASK SCHEDULER

Status
Not open for further replies.

ashley75

Technical User
Oct 4, 2002
94
US
I am a administrator on the server and I wrote a scripts to backup the database. Anyway, when I executed the scripts manually, it ran successfully. When I used to TASK SCHEDULER to schedule the job to be run, it ran sucessfully IF I AM STILL LOG ON THE SERVER; However, when I log off the server, BACKUP IS NOT RUNNING but on the Task schedulers show that it executed and schedule to be run next time.

I suspect it had something to do with some of the services are not running on the server.

Does anyone have any thoughts or advises????

thanks,
 
It's doubtfull your services are shutting down if they are configured for Automatic startup.

How did you schedule the tasks? Try using the command line AT command to do the scheduling.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
the services is started and I am not familiar with AT command. Can you give me some hint to use AT. I still think that it had something to do with some services which I don't know since I am not a sys admin.

thanks
 
ashley75,

Check the properties of the task to see who's account it is being run as...It defaults to the "Local System" account which may have no access to network resources. Change the task to run under your account(or an admin account) and it should be sucessful.

john
 
Ok, I just create an local account with administrator. No luck, it's still not working. what drive me crazy is that the TASK SCHEDULER will run if I STILL LOG ON THE SERVER, but if I log off it won't run.

 
Can you LOCK the computer? Ctrl - Alt - Del | Lock.
 
By the way, this is my client server and I connect to this server using DESKTOP TERMINAL SERVICES, so to answer your question, I can't lock b/c it's terminal services.

Also and I look into the even system log, there was an error and the eventID is 1114.

Any other thoughts???
 
From a command line run AT /? for context on how to schedule with AT.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
My only thought is to set the scheduled task to run as the client's logged in user. For instance, if the machine is logged in as Administrator, set the scheduled task to run as domain\Administrator and the appropriate password. This can be configured through Terminal Services.

That user can remain logged in by locking the machine - which protects the machine locally for the client.

Another option is VNC instead of Terminal Services. With this you log in remotely to the machine, just as if you were at the machine. You will then be using the machine as the client's logged in user and will not have two consecutive active logins (TS & Local).
 
You can connect to the console using the Terminal Services client too, you really don't need VNC for that. I believe you have to end the host name in :0 to get it to connect.

I use the MMC snap in which has a check box for it.



I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Do you think this may have something to do with Remote Dekstop ??? Should I physically schedule the job at the console??? I haven't tried this option since the server located at my client side
 
Have you tried the suggestion of using AT? It will schedule the task to run in the system context.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
You can sometimes get some insight as to why a scheduled job is not running by running it interactively from the schedule.

Log on to the server - you have to be on the console either with vnc, dameware, or if you can get RDP to get to the console.
Then open a command window.
Check the time and type
AT xx:xx /interactive cmd.exe /k
Where xx:xx is like 1 minute from now.
At the scheduled time a new cmd.exe box will pop up.
input the command to run and sit back and watch it.
does it work, does it prompt for any input?

Sometimes this will give you something, and sometimes it won't. But this will make the job run as the scheduled user on the tasks scheduler (as set under the AT Service account on the advanced menu).

There are applications out there that just need to have an active screen to work. I have ran across a few. Logged on works, logged out doesn't and locked might not either. Try to inquire with the application vendor. Sometimes they will fix and sometimes they won't.

Good luck,
Debi
 
You may be able to find specific information about why the task failed by looking at the Sheduled Tasks log. To get to the log open task scheduler, select Advanced, then View Log. It should give you an inidication there why it didn't start.

Most likey your task it trying to run something interactively and will not unless the computer is either locked or actively logged on.

If you want to get a bit tricky you could use the srvany.exe command that comes with the Windows Resource Kit and create a service to start your program for you. The tricky part comes in writing a batch job to delay for x amount of time until you want it to run again. I use a free command line tool sleep.exe for that. The advantage of running it as a service is the computer can be logged of and it will still run your batch job that will kick off your program for you.
 
I had the same problem and found that the task would run properly if it were run on the same account that the server was logged in as but not if it were run under a different account (even if that account were an administrator).
 
Check your local security policy. The user running the batch job should be set to Logon as a batch job. Other policies might need to be set as well, logon as service, act as part of OS, etc.

Debi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top