I have a PowerShell script that produces output to the screen when running it from the PowerShell command line. When I run the PowerShell script as a Scheduled Task, where can I find the output?

link|improve this question
feedback

3 Answers

You won't find your output anywhere from your scheduled task. I would suggest sending your scripts output to a text file, you can do so easily by piping your output to the out-file command, e.g.

get-mailbox |out-file c:\mailboxes.txt

Or output the whole of your files output using a standard DOS file redirect > file.txt

link|improve this answer
feedback

As far as I know, you won't find it anywhere.

You'll need to either open a text file and write the output there, or write a small batch file that redirects standard output to a text file.

For example, I use a batch file something like this:

powershell test.ps1 > output.txt
link|improve this answer
feedback

In a scheduled task just prefix the entire command with cmd /c

example: cmd /c powershell test.ps1 > output.txt

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.