This project has moved and is read-only. For the latest updates, please go here.

Having problem with login type

Oct 27, 2009 at 4:37 AM

Hi All,

I want to use "NT AUTHORITY\SYSTEM" account and switch "Run only if logged on" off. For some reason, the following code doesn't work. The Scheduled task was generated by using current logged on account and "Run only if logged on"option is always on... can someone please help!!


using (var ts = new TaskService()){


                td.Principal.UserId = "SYSTEM";
                td.Principal.LogonType = TaskLogonType.ServiceAccount   ;
                td.Settings.RunOnlyIfLoggedOn = false;
                td.Settings.Enabled = true;








Oct 27, 2009 at 5:53 AM

See for information on using the local system account.