title: Register-ScheduledJob as the system account (without having to pass in credentials)
body: <p>I believe for <code>Register-ScheduledTask</code> you can specify <code>-User "System"</code>or do something like:</p>
  
  <pre><code>$principal = New-ScheduledTaskPrincipal -UserId SYSTEM -LogonType ServiceAccount -RunLevel Highest
  </code></pre>
  
  <p>How do I do this with <code>Register-ScheduledJob</code>?</p>
  
  <p>This command will be running the context of the local admin so it will have access to do this. I just don't see this option in the cmdlet.</p>
  
  <p><a href="https://stackoverflow.com/questions/36846688/powershell-run-job-at-startup-with-admin-rights-using-scheduledjob">Here is an example of how to do this with the scheduled tasks cmdlet</a></p>
  
  <p>edit: Does windows make this impossible by design? If I open an interactive PS session as the system (using psexec) and try to create a schedualed job I get an error:</p>
  
  <pre><code>PS C:\Windows\system32&gt; Register-ScheduledJob -Name systemsssss -ScriptBlock {'s
  dfsdfsdfsd'}
  Register-ScheduledJob : An error occurred while registering scheduled job
  definition systemsssss to the Windows Task Scheduler.  The Task Scheduler
  error is: (32,4):UserId:.
  At line:1 char:1
  + Register-ScheduledJob -Name systemsssss -ScriptBlock {'sdfsdfsdfsd'}
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (Microsoft.Power...edJobDefini
     tion:ScheduledJobDefinition) [Register-ScheduledJob], ScheduledJobExceptio
    n
      + FullyQualifiedErrorId : CantRegisterScheduledJobDefinition,Microsoft.Pow
     erShell.ScheduledJob.RegisterScheduledJobCommand
  </code></pre>
  
  <p>This same command works fine when run as the local administrator account</p>