none
Another Powershell not working from Task Scheduler RRS feed

  • Question

  • I've read several posts and tried allot with no success.  Pretty simple powershell and really surprised the behavior.  Works from command line, works from Task Scheduler when "Run only when user is logged on", But does not run when I check "Run whether use is logged on or not".  Any help would be appreciated.

    PowerShell: FC-DB-Restore.ps1 

    $getf = get-childitem -Path X:\
    $FileFullName = $getf.name
    $x = "X:\" + $FileFullName
    Copy-Item $x G:\FCDB\DBin.bak

    Task Scheduler: FC Import

    Action: Start a program
    Program is fqdn to powershell.exe
    Options: -ExecutionPolicy Bypass -file G:\FC-DB-Restore.ps1
    Start In: G:\

    Thursday, June 22, 2017 5:33 PM

Answers

  • Would the user identity running the script have access to these drive letters?  For example, are they mapped drives?

    You might consider changing them over to UNC path with FQDN and seeing if you get better results.

    • Marked as answer by DND2GO Wednesday, June 28, 2017 1:53 PM
    Thursday, June 22, 2017 6:13 PM

All replies

  • Would the user identity running the script have access to these drive letters?  For example, are they mapped drives?

    You might consider changing them over to UNC path with FQDN and seeing if you get better results.

    • Marked as answer by DND2GO Wednesday, June 28, 2017 1:53 PM
    Thursday, June 22, 2017 6:13 PM
  • Thanks, you are correct that mapped drive was the issue.
    Wednesday, June 28, 2017 1:54 PM