SchTasks fail to pull info from Win 2008 R2
I have a script using schtasks to extract scheduler information from various servers. The script runs on Window 2008 (our monitoring server), the target server could be Win 2003, Win 2008 , Win 2008 R2. It works fine with Win 2003 & Win 2008, but failed on Win 2008 R2 . If I ran the script on my PC (Win 7), it works fine. So I guess somehow the schtasks in Win 2008 does not work well with Win 2008 R2. Any way I can upgrade the schtasks on Win 2008 so that I could pull the task info through ? Sample Errors are as below:- ERROR: Task cannot be loaded: AD RMS Rights Policy Template Management (Manual) ERROR: The task XML contains a value which is incorrectly formatted or out of range. "HostName","TaskName","Next Run Time","Status","Logon Mode","Last Run Time","Last Result","Author","Task To Run","Start In","Comment","Scheduled Task State","Idle Time","Power Management","Run As User","Delete Task If Not Rescheduled","Stop Task If Runs X Hou rs and X Mins","Schedule","Schedule Type","Start Time","Start Date","End Date","Days","Months","Repeat: Every","Repeat: Until: Time","Repeat: Until: Duration","Repeat: Stop If Still Running" ERROR: Task cannot be loaded: PolicyConverter ERROR: The task XML contains a value which is incorrectly formatted or out of range. ERROR: Task cannot be loaded: VerifiedPublisherCertStoreCheck ERROR: The task XML contains a value which is incorrectly formatted or out of range. "HostName","TaskName","Next Run Time","Status","Logon Mode","Last Run Time","Last Result","Author","Task To Run","Start In","Comment","Scheduled Task State","Idle Time","Power Management","Run As User","Delete Task If Not Rescheduled","Stop Task If Runs X Hou rs and X Mins","Schedule","Schedule Type","Start Time","Start Date","End Date","Days","Months","Repeat: Every","Repeat: Until: Time","Repeat: Until: Duration","Repeat: Stop If Still Running" ERROR: The task XML contains a value which is incorrectly formatted or out of range. ERROR: Task cannot be loaded: AitAgent ERROR: The task XML contains a value which is incorrectly formatted or out of range. ERROR: Task cannot be loaded: ProgramDataUpdater "HostName","TaskName","Next Run Time","Status","Logon Mode","Last Run Time","Last Result","Author","Task To Run","Start In","Comment","Scheduled Task State","Idle Time","Power Management","Run As User","Delete Task If Not Rescheduled","Stop Task If Runs X Hou rs and X Mins","Schedule","Schedule Type","Start Time","Start Date","End Date","Days","Months","Repeat: Every","Repeat: Until: Time","Repeat: Until: Duration","Repeat: Stop If Still Running" ERROR: Task cannot be loaded: Proxy ERROR: The task XML contains a value which is incorrectly formatted or out of range. "HostName","TaskName","Next Run Time","Status","Logon Mode","Last Run Time","Last Result","Author","Task To Run","Start In","Comment","Scheduled Task State","Idle Time","Power Management","Run As User","Delete Task If Not Rescheduled","Stop Task If Runs X Hou rs and X Mins","Schedule","Schedule Type","Start Time","Start Date","End Date","Days","Months","Repeat: Every","Repeat: Until: Time","Repeat: Until: Duration","Repeat: Stop If Still Running" ERROR: Task cannot be loaded: SystemTask ERROR: The task XML contains a value which is incorrectly formatted or out of range. ERROR: Task cannot be loaded: UserTask ERROR: The task XML contains a value which is incorrectly formatted or out of range. ERROR: Task cannot be loaded: UserTask-Roam "HostName","TaskName","Next Run Time","Status","Logon Mode","Last Run Time","Last Result","Author","Task To Run","Start In","Comment","Scheduled Task State","Idle Time","Power Management","Run As User","Delete Task If Not Rescheduled","Stop Task If Runs X Hou rs and X Mins","Schedule","Schedule Type","Start Time","Start Date","End Date","Days","Months","Repeat: Every","Repeat: Until: Time","Repeat: Until: Duration","Repeat: Stop If Still Running" ERROR: The task XML contains a value which is incorrectly formatted or out of range.
June 23rd, 2011 3:05pm

Hi, Does any error appear in Event Viewer? Regards, Tim Quan TechNet Subscriber Support in forum If you have any feedback on our support, please contact tnmff@microsoft.com.
Free Windows Admin Tool Kit Click here and download it now
June 24th, 2011 5:23am

Hi, No related errors in System/App logs in the target server (Win 2008 R2). The SchTasks in Win 7/2008 R2 differs from that in Win 2008. In Win 7, it has extra parameter: /ShowSid. Can I just copy the schtasks from a Wind2008 R2 and replace it in Win 2008 ? Or there is more than just copy & paste, that is I have to change the registery key....etc ? thanks, Lan
June 24th, 2011 11:58am

Hi, You can try exporting and importing the scheduled task. Tim Quan Forum Support Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
Free Windows Admin Tool Kit Click here and download it now
June 27th, 2011 9:02am

Hi , I think you mis-understand me. I mean copy Schtask.exe file from Win 2008 R2 and move to Win 2008. I do not need to import/export Scheduled Task, as they are all working. I just have difficulty in query schedule task stuatus via Schtasks command line. thanks, Lan
June 27th, 2011 9:07am

OK, you can have a try first. Tim Quan Forum Support Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
Free Windows Admin Tool Kit Click here and download it now
June 28th, 2011 4:38am

Any update?
July 1st, 2011 5:21am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics