I’m looking for a way to update the credentials on existing scheduled tasks on machines.
- Schtasks doesn’t work for AT created scheduled tasks
- Win32_ScheduledJob only works for AT created jobs
- Schedule.Service COM object – not sure
It appears that I can use RegisterTask and RegisterTaskDefinition to CREATE scheduled tasks but I’m not clear if I can update the existing credentials with those methods. Please advise. Thx.
I would recommend having a look at the managed TaskScheduler API, which is a .NET wrapper for the TaskScheduler COM API. It’s an open-source project available on CodePlex.
http://taskscheduler.codeplex.com/
The project author has this to say about updating passwords:
The appropriate overload for
RegisterTaskDefinitionis defined in TaskFolder.cs.http://taskscheduler.codeplex.com/SourceControl/changeset/view/75611#19440