$ 0 0 Glad you got it. Another options is to remove the 3 lines where you set td.Principal properties and then supply all the parameters to the RegisterTaskDefinition method, including the password and the S4U logon type.