Jens
As you can see in the code and as I mentioned that I am providing the user name (service account) and password and the task scheduled & executed successfully. The problem is that once I add EndDate parameter to the same code it stop working and generate error code “[FAIL ] ITaskScheduler::AddWorkItemn hr=0x80070005”.

What I need is to specify EndDate for the task. Thank you very much.