Tech Support > Microsoft Windows > Windows Server > Scheduled Tasks only Run with Active Session
Scheduled Tasks only Run with Active Session
Posted by bdunwood@gmail.com on May 16th, 2005


Hi,

We've got a Windows Server 2003 Std. Edition. We only have Terminal
Services access to the box.

We're running a number of scheduled tasks (for backups, etc.) and they
all but one task runs properly, regarless of whether or not there is an
active Terminal Services session at the time. All tasks run as a local
administrator.

Our one misbehaving task runs a utility from a 3rd party vendor. That
task only runs properly when we have an active administrator terminal
services session.

If we have a disconected administrator TS session, the task seems to
not run at all.

If we kill all active administrator TS sessions, the task runs, but
does not perform all its work correctly.

The 3rd party vendor claims we must have an active session for the task
to run properly. This (a) sounds bizarre to me, and (b) is not
practical since we only have TS access.

My questions:

1) Does the requirement of an active console/TS session for the task to
run properly sound strange to everyone else?

2) Does anyone know of a work around for this, since we can't maintain
active sessions all the time (and need to run this task several times
an hour).

thanks for any input.

Posted by Pegasus \(MVP\) on May 16th, 2005



<bdunwood@gmail.com> wrote in message
news:1116254373.168742.87290@z14g2000cwz.googlegro ups.com...
Your vendor is talking rubbish. Create a batch file as below,
get the Task Scheduler to run it, then examine the two log files.
You are likely to find the reason for the failure there.

@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>c:\test.err
echo ErrorLevel of c:\Tools\YourTask.exe=%ErrorLevel% >> c:\test.log
echo %date% %time% End of task >> c:\test.log



Posted by Dave Patrick on May 16th, 2005


Yes that sounds ridiculous. Hopefully when you call them back you'll get
someone else to talk to.

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"

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 exist when no one is logged on.

This article may help.

Result Codes in Scheduled Tasks Indicate an Error Occurred in the Task
http://support.microsoft.com/default...;en-us;Q267031

--
Regards,

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

<bdunwood@gmail.com> wrote:
| Hi,
|
| We've got a Windows Server 2003 Std. Edition. We only have Terminal
| Services access to the box.
|
| We're running a number of scheduled tasks (for backups, etc.) and they
| all but one task runs properly, regarless of whether or not there is an
| active Terminal Services session at the time. All tasks run as a local
| administrator.
|
| Our one misbehaving task runs a utility from a 3rd party vendor. That
| task only runs properly when we have an active administrator terminal
| services session.
|
| If we have a disconected administrator TS session, the task seems to
| not run at all.
|
| If we kill all active administrator TS sessions, the task runs, but
| does not perform all its work correctly.
|
| The 3rd party vendor claims we must have an active session for the task
| to run properly. This (a) sounds bizarre to me, and (b) is not
| practical since we only have TS access.
|
| My questions:
|
| 1) Does the requirement of an active console/TS session for the task to
| run properly sound strange to everyone else?
|
| 2) Does anyone know of a work around for this, since we can't maintain
| active sessions all the time (and need to run this task several times
| an hour).
|
| thanks for any input.
|


Posted by bdunwood@gmail.com on May 16th, 2005


Thanks for the replies.

The job is run as 'administrator', so the secrurity rights are ok.

The utility launches a GUI, so I'm wondering if that is a factor.

Still, it only failes to run when a session is 'disconnected'. If there
are no current sessions, it runs, but runs improperly or incompletely.

I'm running the suggested test now to see if any useful mesgs are
trapped.

thank you for the suggestions and the validation that this requirement
is a bit odd.

Posted by Dave Patrick on May 16th, 2005


<bdunwood@gmail.com> wrote:
| Thanks for the replies.
|
| The job is run as 'administrator', so the secrurity rights are ok.
* This may not matter. Administrator of what?

| The utility launches a GUI, so I'm wondering if that is a factor.
* Yes this is a problem. The developer needs to change this.


--
Regards,

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



Similar Posts