title: Programmatically creating scheduled tasks fails on Windows 10 unless "run as admin" is used
body: <p>The app I'm participating adds tasks to Windows Task Sheduler. It works fine on Windows 7, but on Win 8.1 and Win 10 the access is denied unless "run as admin" is used.</p>
  
  <p>The app must be launched with "run as admin" permissions in order to create the scheduled task.</p>
  
  <p>I cannot share the code, because it doesn't belong to me. Anyway, maybe someone can answer it.</p>
  
  <p>My gues is that in Windows 8.1 (and later) the permission level for scheduled tasks changed and Administrative permissions are required. But I cannot find a proof of it and any possible alternatives to programmatically add Scheduled Tasks in Windows 10 without admin rights.</p>
  
  <p>The code uses Microsoft.Win32.TaskScheduler lib. The code below is simplified to show the way it's written and classes/parameters are used.</p>
  
  <pre><code>    var taskDefinition = Microsoft.Win32.TaskScheduler.TaskService.NewTask();
      taskDefinition.Principal.LogonType = Microsoft.Win32.TaskScheduler.TaskLogonType.S4U; 
      taskDefinition.Principal.UserId = "";
  </code></pre>
  
  <p>then it adds the action and trigger</p>
  
  <pre><code>    taskDefinition.Actions.Add(executeAction);
      taskDefinition.Triggers.Add(trigger);
  </code></pre>
  
  <p>then register the task</p>
  
  <pre><code>    Microsoft.Win32.TaskScheduler.TaskService.RootFolder.RegisterTaskDefinition(taskName, taskDefinition);
  </code></pre>