none
Scheduled task not running on Windows Server 2008 but working on Windows XP RRS feed

  • Question

  • Hi,

    I have created a console application using .NET 3.5 framework for fetching data from the oracle database and sending it as an attachment via email.

    Using the task scheduler I have scheduled a task to run the console application's .exe file at 9 AM every day.

    The task is scheduled properly and works fine on a Windows XP machine and doesn't work on windows 2008 server.

    When the task is run for the first time on XP and installation prompt is displayed. Once the installation is done from the next time onwards the task is getting executed as scheduled without any issues.

    In case of windows server 2008, I did not get any installation prompt, so I went ahead and double clicked the .exe file to install it on the server and scheduled it. I am getting a 'success' message every time it executes, but the data is not being sent as a mail which means the .exe program is not executed. I have used domain credentials as well as the machine's administrator credentials to verify this.

    I have also checked the firewall settings and there is no issue with it as it is turned off.

    I have checked the logs in event viewer, but no error messages have been logged.

    Please let me know if there is a solution to this issue.

    Thank you.

     

    Regards,

    Badarinath Pennati.

    Wednesday, September 8, 2010 9:15 AM

All replies

  • Take a look at the following KB.

    http://support.microsoft.com/kb/951246/en-us


    MCITP: Enterprise Messaging Administrator 2007/2010 | MCITP: Server Administrator | MCTS: Windows Server 2008 Applications Infrastructure, Configuring | MCP | MCDST
    Wednesday, September 8, 2010 3:00 PM
  • Hi Tom,

    Thanks for the reply. The KB suggested by you does not contain the solution for my issue. I have tried creating the task from command prompt. The task gets scheduled properly when created from the command prompt or through user interface.

    But when the task is run I am still getting the message as "The operation completed successfully. (0x0)" without the task getting executed completely. I have placed a log statement at the start of the program, and no information is logged which means the program is not invoked by the scheduler. This issue occurs only in Windows Server 2008.

    Since I am not using the command prompt for executing the service, I don't think the hot fix suggested in the above KB holds good.

     

    Thursday, September 9, 2010 12:09 AM
  • On the properties of the task that was created in the Task Scheduler, what do you have selected in the Configure for section. Is it the option Windows Vista, Windows Server 2008?

    Also, under the Security Options of the task in the General tab, can you choose the following option Run with highest Privileges then confirm if it exectues successfully.

    If it is still failing after trying the above, then as a test can you try the following adding the scheduled task in the Startup folder (C:\Users\<admin_acct>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup) and see if it exectues successfully.

    Regards,

    Tom


    MCITP: Enterprise Messaging Administrator 2007/2010 | MCITP: Server Administrator | MCTS: Windows Server 2008 Applications Infrastructure, Configuring | MCP | MCDST
    Thursday, September 9, 2010 2:14 AM
  • Hi Tom,

    Thanks again!

    In the configure section I have selected 'Windows Vista, Windows Server 2008' option.

    Currently I am using the 'run with highest privileges' option in my task because of which I am getting 'The operation completed successfully' message, else I used to get an error log in event viewer even when the task is executed successfully.

    Following is the log data:

    Log Name:      System
    Source:        Microsoft-Windows-DistributedCOM
    Date:          9/1/2010 9:00:02 AM
    Event ID:      10016
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          DMNNAME\UsrName
    Computer:      server1.win.excera.net
    Description:
    The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID
    {33246F92-D56F-4E34-837A-9A49BFC91DF3}
     to the user DMNNAME\UsrName SID (S-1-5-21-1535773150-520773558-1539857752-506717) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-Windows-DistributedCOM" Guid="{1B562E86-B7AA-4131-BADC-B6F3A001407E}" EventSourceName="DCOM" />
        <EventID Qualifiers="49152">10016</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>0</Task>
        <Opcode>0</Opcode>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2010-09-01T13:00:02.000Z" />
        <EventRecordID>80832</EventRecordID>
        <Correlation />
        <Execution ProcessID="0" ThreadID="0" />
        <Channel>System</Channel>
        <Computer>server1.win.excera.net</Computer>
        <Security UserID="S-1-5-21-1535773150-520773558-1539857752-506717" />
      </System>
      <EventData>
        <Data Name="param1">machine-default</Data>
        <Data Name="param2">Local</Data>
        <Data Name="param3">Activation</Data>
        <Data Name="param4">{33246F92-D56F-4E34-837A-9A49BFC91DF3}</Data>
        <Data Name="param5">DMNNAME</Data>
        <Data Name="param6">UsrName</Data>
        <Data Name="param7">S-1-5-21-1535773150-520773558-1539857752-506717</Data>
        <Data Name="param8">LocalHost (Using LRPC)</Data>
      </EventData>
    </Event>

    If I am selecting the 'run with highest privileges' option I am not getting any information logged to the System log.

    Even executing the program from the startup of an admin user did not help.

    Please note that the application I want to schedule is an .exe file obtained from a .NET 3.5 console application. All the supporting files like config and manifest files are present along with the executable.

    Thursday, September 9, 2010 3:35 AM
  • Hi Tom,

    Another observation made. When I double click the .exe file on XP the application is executing and sending an email. But if I do the same on Windows Server 2008, the application is not getting executed.

    So, the issue is not with the Task Scheduler. Probably it should be with Server or Network settings.

    My UserID has admin access on the Server machine. And I have also used the actual system's administrator credentials to check  this issue. In both the cases I am unable to execute the application.

    Thursday, September 9, 2010 3:49 AM
  • Have the same problem.

    Have an exe file that is scheduled on the Server 2008 R2. The scheduler starts the process, however, program is not executed. I have no problem scheduling this program in Win XP. Yet, on Server 2008 it looks like a process is created by task scheduler but the program is not executed.

    Would appreciate a help. Tried everything recommended above - does not help
    Monday, October 25, 2010 4:18 PM
  • I know its being long time but I had the same problem today, Once i have changed Option to   Run only when usrer is logged on , it worked
    • Proposed as answer by esteban2800 Sunday, May 20, 2012 4:54 PM
    Monday, March 28, 2011 9:18 AM
  • I have the same problem. I can run a program via Command Line and via .bat file, however, when i schedule this process, the scheduler reports that it has run correctly and without errors, however, the program is not being run. I have tried privilege changes, different variations on writing the task commends etc. but nothing is working - really need some help on this as it is doing my head in !!
    Friday, April 15, 2011 4:53 PM
  • I'm also able to run my executable when I select Run only when usrer is logged on, but I can't stay logged in with the account. Has anyone found a solution?
    Imperfect IT - Because when does anything work the way it's supposed to? http://imperfectit.blogspot.com/
    Wednesday, May 4, 2011 9:29 PM
  • I had this exact same issue and was able to fix it on my end.  My problem was that Server 2008's Task Scheduler defaults to a system directory as the "Start In" path if you don't set one.  So even though my task's action was to run D:\websites\site\bin\MyApp.exe, the exe was being run as if it were in the system directory, preventing it from finding the web.config file it needed to reference.  By setting the Start In path manually (under the Action properties) to D:\websites\site\bin, the task started working perfectly.
    Friday, May 20, 2011 7:45 PM
  • Hi Danny

    The solution worked for me.

    Thanks

    Prashant Channe

    Tuesday, June 28, 2011 11:18 AM
  • Thank you kindly, DannyBGood.

    Changing the "Start In" path did correct this issue for me. :)

    Tuesday, September 20, 2011 12:14 AM
  • Thanks Danny, It`s worked for me
    • Edited by Sdeepsingh Thursday, September 22, 2011 5:47 AM
    Thursday, September 22, 2011 5:46 AM
  • Many thanks! Helped us too.

    Monday, January 16, 2012 11:27 AM
  • Thanks Danny,

    Your solution works form me also.

    FDL


    Fabrizio FDL

    Thursday, May 31, 2012 1:04 PM
  • The solution worked for me.

    Thanks,

    James Ward

    Wednesday, August 8, 2012 4:49 PM
  • This was the answer for me too.  Initially it did not work, but after moving the executable to a path that did not contain spaces and then entering the path info in the start in directory = voila, success!  Using quotes around the path which contained spaces resulted in an invalid directory error in the event viewer.  Thanks for sharing this info.

    Friday, September 7, 2012 4:32 PM
  • Thanks Danny,

    This worked for me as well.

    Thursday, October 4, 2012 2:59 PM
  • Thanks!  Just spent half a day figuring this one out.
    Thursday, November 15, 2012 8:23 PM
  • Thanks. Once I set the "Start In" it worked like a charm. My path also had spaces and (), still it worked.
    Wednesday, November 28, 2012 6:53 PM
  • Thank you kindly, DannyBGood.

    Changing the "Start In" path did correct this issue for me. :)


    "Start In" also works for me.Thank you all.
    Saturday, December 22, 2012 7:26 AM
  • thanks for the tips, it did solve my problem as well.
    Monday, July 22, 2013 1:57 PM
  • Tks, Its Worked for me too!
    Thursday, October 10, 2013 2:00 PM
  • Awesome, that did it for me!

    Wednesday, December 11, 2013 1:45 PM
  • Changing the start in property worked perfectly! Thank You! 
    Thursday, June 12, 2014 6:22 PM
  • This helps. After defining the Start In Path, which though is optional, I am able to run the scheduled tasks successfully. Thanks a lot.
    Tuesday, August 12, 2014 2:59 AM
  • This worked for me as well. My program kept running as a service but I had the option to "start weather the user was logged on or off". Once I changed that option to "only run if the user is logged on" and I also changed the start in folder; now my application is starting normally.

    Saturday, April 18, 2015 3:44 AM
  • I had this exact same issue and was able to fix it on my end.  My problem was that Server 2008's Task Scheduler defaults to a system directory as the "Start In" path if you don't set one.  So even though my task's action was to run D:\websites\site\bin\MyApp.exe, the exe was being run as if it were in the system directory, preventing it from finding the web.config file it needed to reference.  By setting the Start In path manually (under the Action properties) to D:\websites\site\bin, the task started working perfectly.
    FIXED IT FOR ME!  THANKS.
    Thursday, April 23, 2015 11:01 AM
  • RunningGently!!!!!!!! THANK YOU!!!

    FINALLY!!! YAY!!! 5 STARS!!!

    Tuesday, November 22, 2016 11:18 PM
  • Long time passed since I asked this question.

    To close his thread:

    This was solved in very simple way. I have changed the "User Account" from mine to "SYSTEM". Also works nice when I set user account to "USERS".
    • Proposed as answer by Viktorka Friday, September 15, 2017 7:55 PM
    Friday, September 15, 2017 7:55 PM