Nov 27, 2012 at 6:05 PM
Edited Nov 27, 2012 at 6:25 PM
I am using TaskService class running on Windows server 2008 system to connect remotely to Task Scheduler on another Windows server system. The relevant code snippet follows:
var ts = new TaskService(IP address, userId, domain, password);
foreach (Task task in ts.RootFolder.Tasks)
This works great when the target is Windows 2008, but with Windows server 2012 I get the following COM exception:
"The task XML contains a value which is incorrectly formatted or out of range. (Exception from HRESULT: 0x80041318)"
I examined the Task's Xml property returned above. The only difference I see is that it is <Task version=\"1.4\" for Windows 2012, but <Task version=\"1.3\" or lower when remote system is Windows 2008 or Windows 7.
Is there a way to target Win 2012 Task Scheduler remotely from Windows 2008 system?