Yes. That's correct. I somehow missed it the last time I tried to respond.
So just for an FYI in case somebody hits this roadblock, if you plan to use the S4U logon type, you will need to pass the credentials of an Administrator while registering the task or the user himself needs to be part of the local administrator group.
My user for whom I'm trying to register this task for is a normal user without any such priveleges.
Below is a correction to the above response for registering the task.
So just for an FYI in case somebody hits this roadblock, if you plan to use the S4U logon type, you will need to pass the credentials of an Administrator while registering the task or the user himself needs to be part of the local administrator group.
My user for whom I'm trying to register this task for is a normal user without any such priveleges.
Below is a correction to the above response for registering the task.
ts.RootFolder.RegisterTaskDefinition("MFT Console Application", td, TaskCreation.CreateOrUpdate,
System.Security.Principal.WindowsIdentity.GetCurrent().Name, null, __TaskLogonType.None__);