Scheduled Tasks and User Accounts

G

Guest

I created scheduled tasks in Windows 2000 and 2003 server to execute a couple
batch scripts. I created a new user specifically for running scheduled tasks
and assigned it to the administrators group. The scheduled tasks will run but
it does not actually complete the processing of the batch files. The error
code shows that it ran fine and the logs do not show any errors. If I change
the account that the scheduled tasks run under to the local admin. account,
the scheduled tasks complete successfully.

Does the account that a scheduled task runs under have to have a profile
created on the server in order for it to be used for running scheduled tasks?
I created that user specifically for running scheduled tasks, but I've never
logged on to the server as that user, thereby creating a profile for it. If
this isn't need, does anyone have any other ideas why it wouldn't run under a
different account with administrator privleges?
 
P

Pegasus \(MVP\)

Marks70 said:
I created scheduled tasks in Windows 2000 and 2003 server to execute a couple
batch scripts. I created a new user specifically for running scheduled tasks
and assigned it to the administrators group. The scheduled tasks will run but
it does not actually complete the processing of the batch files. The error
code shows that it ran fine and the logs do not show any errors. If I change
the account that the scheduled tasks run under to the local admin. account,
the scheduled tasks complete successfully.

Does the account that a scheduled task runs under have to have a profile
created on the server in order for it to be used for running scheduled tasks?
I created that user specifically for running scheduled tasks, but I've never
logged on to the server as that user, thereby creating a profile for it. If
this isn't need, does anyone have any other ideas why it wouldn't run under a
different account with administrator privleges?

Modify your batch file as below, schedule it, then examine
the log file. I expect that all will become clear!

@echo off
echo %date% %time% Start of task > c:\test.log
echo User=%UserName%, Path=%path% >> c:\test.log
c:\Tools\YourTask.exe 1>>c:\test.log 2>>&1
echo ErrorLevel of c:\Tools\YourTask.exe=%ErrorLevel% >> c:\test.log
echo %date% %time% End of task >> c:\test.log
 
G

Guest

Thanks for your response. Sorry to ask a stupid question, but do I need to
modify your lines that read "c:\Tools\YourTask.exe", and if so, am I just
putting in the path to the task I want to execute?
 
G

Guest

And just for clarification, the task I'm trying to execute is simply the
batch script.
 
P

Pegasus \(MVP\)

Yes, this is what you need to do.


Marks70 said:
Thanks for your response. Sorry to ask a stupid question, but do I need to
modify your lines that read "c:\Tools\YourTask.exe", and if so, am I just
putting in the path to the task I want to execute?
 
D

Dave Patrick

Scheduled Tasks|Advanced|View Log may provide some details. If the job
connects to another machine you may need to add the user/ group 'logon as
batch job' rights (server side). Control Panel|Admin Tools|Local Security
Policy\Local Policies\User Rights Assignments
"Log on as a batch job"

If the task completes but the job does not then there is a problem in the
job itself. Remember that if it involves network resources to make sure the
user account has permissions to the resources and also use UNC paths as
mapped drives won't natively exist when no one is logged on.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
|I created scheduled tasks in Windows 2000 and 2003 server to execute a
couple
| batch scripts. I created a new user specifically for running scheduled
tasks
| and assigned it to the administrators group. The scheduled tasks will run
but
| it does not actually complete the processing of the batch files. The error
| code shows that it ran fine and the logs do not show any errors. If I
change
| the account that the scheduled tasks run under to the local admin.
account,
| the scheduled tasks complete successfully.
|
| Does the account that a scheduled task runs under have to have a profile
| created on the server in order for it to be used for running scheduled
tasks?
| I created that user specifically for running scheduled tasks, but I've
never
| logged on to the server as that user, thereby creating a profile for it.
If
| this isn't need, does anyone have any other ideas why it wouldn't run
under a
| different account with administrator privleges?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top