title: Task Scheduler Run Whether User Logged Or Not Issue
body: <p>I'm running a powershell script with task scheduler and it runs fine when the option 'run when the user is logged on' is selected.</p>
  
  <p>This isn't efficient for obvious reasons. Is there a specific reason as to why when I choose 'run whether user is logged on or not' that the script doesn't run?</p>
  
  <p>I've tried with local admin as well and my account. I have full administrator rights so I don't see it as a permissions issue. Any clues?</p>
  
  <p>Thank you so much</p>
  
  <p>This is the task scheduler export xml.</p>
  
  <p>FYI, the script opens an excel, refreshes all connections, and saves.
  (The file is in the one drive) Regardless of it being in the one drive or not, it doesn't refresh a file on my desktop.</p>
  
  <p>I have even tried passing the UNC path in the script as opposed to C:/users/--</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-16"?&gt;
  &lt;Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"&gt;
    &lt;RegistrationInfo&gt;
      &lt;Date&gt;2015-05-28T09:34:25.8180083&lt;/Date&gt;
      &lt;Author&gt;-----&lt;/Author&gt;
    &lt;/RegistrationInfo&gt;
    &lt;Triggers&gt;
      &lt;TimeTrigger&gt;
        &lt;Repetition&gt;
          &lt;Interval&gt;PT1H&lt;/Interval&gt;
          &lt;StopAtDurationEnd&gt;false&lt;/StopAtDurationEnd&gt;
        &lt;/Repetition&gt;
        &lt;StartBoundary&gt;2015-05-29T08:20:00&lt;/StartBoundary&gt;
        &lt;Enabled&gt;true&lt;/Enabled&gt;
      &lt;/TimeTrigger&gt;
    &lt;/Triggers&gt;
    &lt;Principals&gt;
      &lt;Principal id="Author"&gt;
        &lt;UserId&gt;------&lt;/UserId&gt;
        &lt;LogonType&gt;Password&lt;/LogonType&gt;
        &lt;RunLevel&gt;HighestAvailable&lt;/RunLevel&gt;
      &lt;/Principal&gt;
    &lt;/Principals&gt;
    &lt;Settings&gt;
      &lt;MultipleInstancesPolicy&gt;IgnoreNew&lt;/MultipleInstancesPolicy&gt;
      &lt;DisallowStartIfOnBatteries&gt;true&lt;/DisallowStartIfOnBatteries&gt;
      &lt;StopIfGoingOnBatteries&gt;true&lt;/StopIfGoingOnBatteries&gt;
      &lt;AllowHardTerminate&gt;true&lt;/AllowHardTerminate&gt;
      &lt;StartWhenAvailable&gt;false&lt;/StartWhenAvailable&gt;
      &lt;RunOnlyIfNetworkAvailable&gt;false&lt;/RunOnlyIfNetworkAvailable&gt;
      &lt;IdleSettings&gt;
        &lt;StopOnIdleEnd&gt;true&lt;/StopOnIdleEnd&gt;
        &lt;RestartOnIdle&gt;false&lt;/RestartOnIdle&gt;
      &lt;/IdleSettings&gt;
      &lt;AllowStartOnDemand&gt;true&lt;/AllowStartOnDemand&gt;
      &lt;Enabled&gt;true&lt;/Enabled&gt;
      &lt;Hidden&gt;false&lt;/Hidden&gt;
      &lt;RunOnlyIfIdle&gt;false&lt;/RunOnlyIfIdle&gt;
      &lt;WakeToRun&gt;false&lt;/WakeToRun&gt;
      &lt;ExecutionTimeLimit&gt;P3D&lt;/ExecutionTimeLimit&gt;
      &lt;Priority&gt;7&lt;/Priority&gt;
    &lt;/Settings&gt;
    &lt;Actions Context="Author"&gt;
      &lt;Exec&gt;
        &lt;Command&gt;powershell&lt;/Command&gt;
        &lt;Arguments&gt;-File "scriptpathhere"&lt;/Arguments&gt;
      &lt;/Exec&gt;
    &lt;/Actions&gt;
  &lt;/Task&gt;
  </code></pre>