Hi I am having the same issue.
OS = Win8 and Win Server 2008 R2.
I tried below code
td.Principal.GroupId = "NT AUTHORITY\NETWORK SERVICE";
td.Principal.LogonType = TaskLogonType.S4U;
also tried the code above.
But I get access denied error.
How can I create a task which can run as "NETWORK SERVICE" and "user logged in or not"
thanks
OS = Win8 and Win Server 2008 R2.
I tried below code
td.Principal.GroupId = "NT AUTHORITY\NETWORK SERVICE";
td.Principal.LogonType = TaskLogonType.S4U;
also tried the code above.
But I get access denied error.
How can I create a task which can run as "NETWORK SERVICE" and "user logged in or not"
thanks