Getting tasks and modifying their useraccounts

Jul 2, 2012 at 2:22 PM

Hello,

 

im hoping to get some help on my problem.

im trying to make something that will change the password of a task if it has defined a username/password

if possible i would like to do if task has username admin in it then change password to xx

i already found the way how to update the task, only i need to find a way to list all tasks and see under what user they are running

i hope i was able to explain myself well enough.

Regards,

Reinier van Dijk

Coordinator
Jul 2, 2012 at 5:34 PM

Use the Enumerate all task example (http://taskscheduler.codeplex.com/wikipage?title=Examples#enum) and then use the Task.TaskDefinition.Principal.UserId property to get the username. Once you have that, you can use TaskFolder.RegisterTaskDefinition method to re-register the task with a different set of credentials.

Jul 5, 2012 at 7:14 AM

Thanks for the reply, this was exactly what i needed!