It is working now with following code
ts.RootFolder.RegisterTaskDefinition(@"ImportBloodLossData", td, TaskCreation.Create, td.Principal.UserId, password, td.Principal.LogonType)
this works when whether the user is logged on or not
Thanks all!
ts.RootFolder.RegisterTaskDefinition(@"ImportBloodLossData", td, TaskCreation.Create, td.Principal.UserId, password, td.Principal.LogonType)
this works when whether the user is logged on or not
Thanks all!