locked
Scheduled task does not work if user is not logged on RRS feed

  • السؤال

  • Hi,

    We are trying to drive a backup from a certain database (interbase6) running on Windows 2003 Server. The backup is driven with the software providers own .exe + parameters wanted. I have added those to a simple .cmd file.

    The problem is that we would like to schedule the backup to drive it daily but if not logged on, the software seems to just start running on the backround and nothing happens. Status at task scheduler just shows "running".

    I have tried to schedule the backup to be driven on nt authority\system account also, this made no difference. When im logged on locally, everything works just fine.

    Also if logged on via RemoteDesktop, i get an error: "cannot attach to services manager", i am assuming for same reason the backup is not doing anything when logged off.

     

    Any ideas on how to work around this outside leaving the domain admin account logged on 24/7.

    02/ذو الحجة/1431 11:23 ص

الإجابات

  • You might check your interbase support web site. Seems the error message cannot attach to services manager is quite common for other reasons.

     

     

     


    Regards, Dave Patrick .... Microsoft Certified Professional -Microsoft MVP [Windows]
    • تم وضع علامة كإجابة بواسطة Tim Quan 05/ذو الحجة/1431 02:30 ص
    03/ذو الحجة/1431 03:54 م

جميع الردود

  • Hi,

     

    This is expected.

     

    You can specify that a task should run even if the account under which the task is scheduled to run is not logged on when the task is triggered. To do this, select the radio button labeled Run whether user is logged on or not. If this radio button is selected, tasks will not run interactively. To make a task run interactively, select the Run only when user is logged on radio button.

     

    http://technet.microsoft.com/en-us/library/cc722152.aspx

     

    Tim Quan

    03/ذو الحجة/1431 02:26 ص
  • Hi Tim and thanks for your reply.

    The link you provided refers to 2008 server and I am on 2003 server, are the menus / options same?

    I will look in to it better later today but as far as I have seen, there has been no other options in task scheduler regarding logging than the "Run only if user is logged on" box which is unchecked.

    Where should this "radio button" "Run whether user is logged on or not" be?

    I will read the instructions at the posted url more carefully later today and keep you posted. -Mkko

    03/ذو الحجة/1431 09:51 ص
  • 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.



    Also check the logs for clues.

    Scheduled Tasks|Advanced|View Log


    Regards, Dave Patrick .... Microsoft Certified Professional -Microsoft MVP [Windows]
    03/ذو الحجة/1431 10:29 ص
  • Hi again,

     

    Tim: it seems to be as you descriped on 2008 server, on 2003 there is only "run only if user is logged on" which is not checked.

     

    Dave: The task is made locally on the machine that drives the backup and the database it backs up is locally on the same machine.

    I have created it with domain admin account and added its credentials to the task, the account also has "log on as batch job" rights.

    The drives contained in the .cmd file parameters are local drives, not network drives.

     

    The task starts but stays in "running" state, when im logged on with the domain admin account i created the task with, it drives it and thats it. (takes only few seconds for it to back up the database file, cmd flashes once and the job is done)

    As if the "backup".exe file refered in the .cmd file that is scheduled would be stuck.

     

    So it seems that the task is actually working, as scheduled, it executed the .cmd file that has been scheduled.

    Problem is that the .exe file does not do its job while not logged on.

    It acts pretty much the same as when I try to do it when logged on with Remote Controll but i get no error messages obviously cause I am not logged on while it drives it.

     

    So why can it not "attach to services manager" while not logged on?

    Is there a special right for UA regarding that?

    03/ذو الحجة/1431 02:25 م
  • You might check your interbase support web site. Seems the error message cannot attach to services manager is quite common for other reasons.

     

     

     


    Regards, Dave Patrick .... Microsoft Certified Professional -Microsoft MVP [Windows]
    • تم وضع علامة كإجابة بواسطة Tim Quan 05/ذو الحجة/1431 02:30 ص
    03/ذو الحجة/1431 03:54 م
  • Hi,

    It seems indeed that the problem is with the interbase backup, not with the task it self.

    Thanks a lot for your responses, this thread can be closed.

    04/ذو الحجة/1431 08:51 ص
  • You're welcome.

     

     

     


    Regards, Dave Patrick .... Microsoft Certified Professional -Microsoft MVP [Windows]
    04/ذو الحجة/1431 10:23 ص