Windows 2008 Task Scheduler PowerShell Script Output

task-scheduler

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?

Best Answer

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