Trying to schedule a task in Global.asax on a 2008 R2 machine. The task scheduling works fine locally (Win 7), but remotely I get:
[COMException (0x80041318): (42,4):Task:]
System.Runtime.InteropServices.COMException: (42,4):Task:
It seems like this is an error in the XML, but when I import the XML manually in to the Task Scheduler UI it works fine.
Here is the XML:
<?xml version="1.0" encoding="UTF-16"?> <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo> <Author>Project.Name</Author> </RegistrationInfo> <Triggers> <CalendarTrigger> <StartBoundary>2012-09-07T16:52:47.912</StartBoundary> <Enabled>true</Enabled> <ScheduleByDay> <DaysInterval>1</DaysInterval> </ScheduleByDay> </CalendarTrigger> </Triggers> <Settings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>false</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> <IdleSettings> <Duration>PT10M</Duration> <WaitTimeout>PT1H</WaitTimeout> <StopOnIdleEnd>true</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <RunOnlyIfIdle>false</RunOnlyIfIdle> <WakeToRun>false</WakeToRun> <ExecutionTimeLimit>PT72H</ExecutionTimeLimit> <Priority>7</Priority> </Settings> <Actions> <Exec> <Command>C:\inetpub\wwwroot\bin\myjob.EXE</Command> <Arguments>--job=JobName --params param1="value"</Arguments> </Exec> </Actions> </Task>
Any thoughts?