Quantcast
Channel: Task Scheduler Managed Wrapper
Viewing all articles
Browse latest Browse all 2206

New Post: COMException connecting to Windows 2012 Task Scheduler remotely

$
0
0

The property accessor task.Definition is throwing the exception:

System.Runtime.InteropServices.COMException (0x80041318): The task XML contains
a value which is incorrectly formatted or out of range. (Exception from HRESULT:
 0x80041318)
   at Microsoft.Win32.TaskScheduler.V2Interop.IRegisteredTask.get_Definition()
   at Microsoft.Win32.TaskScheduler.Task.get_Definition()

And task.Xml is:

<?xml version=\"1.0\" encoding=\"UTF-16\"?>\r\n<Task version=\"1.4\" xmlns=\"http://schemas.microsoft.com/windows/2004/02/mit/task\">\r\n  <RegistrationInfo>\r\n    <Source>$(@%SystemRoot%\\system32\\twinapi.dll,-8000)</Source>\r\n   <Author>$(@%SystemRoot%\\system32\\twinapi.dll,-8001)</Author>\r\n    <Description>$(@%SystemRoot%\\system32\\twinapi.dll,-8002)</Description>\r\n  </RegistrationInfo>\r\n  <Triggers>\r\n    <IdleTrigger>\r\n      <Enabled>true</Enabled>\r\n    </IdleTrigger>\r\n </Triggers>\r\n  <Principals>\r\n    <Principal id=\"AnyUser\">\r\n      <UserId>S-1-5-21-3496727714-3193957637-3381071595-500</UserId>\r\n      <LogonType>InteractiveToken</LogonType>\r\n      <RunLevel>LeastPrivilege</RunLevel>\r\n    </Principal>\r\n  </Principals>\r\n <Settings>\r\n    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>\r\n    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>\r\n    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>\r\n    <AllowHardTerminate>false</AllowHardTerminate>\r\n   <StartWhenAvailable>false</StartWhenAvailable>\r\n    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>\r\n    <IdleSettings>\r\n      <Duration>PT0M</Duration>\r\n      <StopOnIdleEnd>false</StopOnIdleEnd>\r\n      <RestartOnIdle>false</RestartOnIdle>\r\n   </IdleSettings>\r\n    <AllowStartOnDemand>true</AllowStartOnDemand>\r\n    <Enabled>false</Enabled>\r\n    <Hidden>false</Hidden>\r\n    <UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>\r\n    <RunOnlyIfIdle>true</RunOnlyIfIdle>\r\n    <WakeToRun>false</WakeToRun>\r\n   <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>\r\n    <Priority>7</Priority>\r\n  </Settings>\r\n  <Actions Context=\"AnyUser\">\r\n    <ComHandler>\r\n      <ClassId>{2D3F8A1B-6DCD-4ED5-BDBA-A096594B98EF}</ClassId>\r\n      <Data><![CDATA[$(Arg0)]]></Data>\r\n   </ComHandler>\r\n  </Actions>\r\n</Task>"


Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>