The property td.Settings.RunOnlyIfLoggedOn is marked as version 1 only.
For v2 tasks is seems to always return True
How can we identify if a v2 task is set to 'Run whether user is logged on or not'?
Looks like RunOnlyIfLoggedOn is True in v2 tasks if the LogonType is:
TASK_LOGON_INTERACTIVE_TOKEN or TASK_LOGON_GROUP.
Please consider hiding that complexity by adding READ ONLY access to the RunOnlyIfLoggedOn proeprty even for v2 tasks. That would also remove the uncertainty (I'm not sure that the logic above is indeed complete).
For v2 tasks is seems to always return True
How can we identify if a v2 task is set to 'Run whether user is logged on or not'?
Looks like RunOnlyIfLoggedOn is True in v2 tasks if the LogonType is:
TASK_LOGON_INTERACTIVE_TOKEN or TASK_LOGON_GROUP.
Please consider hiding that complexity by adding READ ONLY access to the RunOnlyIfLoggedOn proeprty even for v2 tasks. That would also remove the uncertainty (I'm not sure that the logic above is indeed complete).