This project has moved. For the latest updates, please go here.

Server 2008 "Do not store password" being reset

Topics: Errors
Oct 3, 2014 at 12:32 PM
When I change the password (or do any kind of update) to an existing task on Server 2008, the "Do not store password" checkbox is always reset to Checked.

Possibly related, in the debugger I always see td.Settings.RunOnlyIfLoggedOn = true.

I am doing the update with:
TaskDefinition td = task.Definition;
taskservice.RootFolder.RegisterTaskDefinition(.taskname, td, TaskCreation.CreateOrUpdate,
                                                             username,password);
task was retrieved with:
taskservice.RootFolder.Tasks[i];

Is there some way to make it leave the "Do not store password" setting alone?

Bill
Oct 3, 2014 at 12:46 PM
I figured it out myself. I needed to add TaskLogonType.Password.

DOH!
Marked as answer by dahall on 10/3/2014 at 9:18 AM