title: Powershell Scheduled return code 2147942401
body: <p>I create a task Schedule by below code in powershell,</p>
  <pre><code>#Variables
  $TaskName = &quot;Audit Large Lists&quot;
  $username =&quot;Crescent\SP13_FarmAdmin&quot;
  $password =&quot;Password Here&quot;
  #Create Scheduled Task
  $Action = New-ScheduledTaskAction -Execute &quot;PowerShell.exe&quot; -Argument &quot;E:\Scripts\Cleanup.ps1&quot;
  $Trigger = New-ScheduledTaskTrigger -Daily -At 1am
  $ScheduledTask = New-ScheduledTask -Action $action -Trigger $trigger 
  Register-ScheduledTask -TaskName $Tas
  </code></pre>
  <p>when task run return this massage as task completed:</p>
  <p>Task Scheduler successfully completed task &quot;\CleanUp&quot; , instance &quot;{0e729095-760d-93zx-b51f-7fd15b49d555}&quot; , action &quot;PowerShell.exe&quot; with return code 2147942401.</p>
  <p>but the powershell code do not run.</p>
  <p>I try &quot;Run as Previl...&quot; and many sloution to solve it but it not work.</p>