Q:

Cannot get Exchange PowerShell script to run under Scheduled Tasks

I have a PowerShell script that works when entered directly into the PowerShell. The PowerShell program is run with the shorcut:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1'"

I have tried about 10 different ways in Windows Task Scheduler to first open the shortcut above and then run my saved script file but it won't work. It hangs on 'Running'.
The script is located here:
Z:\Exchange PowerShell\MailboxesApproachingOverQuota.ps1

Note that script content can be copied and pasted into the PowerShell shortcut above and it runs absolutely fine and emails me the output as it should. 
Note that the PowerShell instance I use is from the shortcut shown above which already has arguments in it - hence why I'm stumped what to put where in Task Scheduler.
Any help please?
Thanks :)

EDIT When I use the following directly in CMD:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1'; &'Z:\Exchange Powershell\MailboxesApproachingOverQuota.ps1'"

I get:  http://tinypic.com/r/n1fkmg/8
When I use the following:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1'; &'Z:\Exchange Powershell\MailboxesApproachingOverQuota.ps1'"

I get: http://tinypic.com/r/5bbac9/8
Running this:
powershell -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -exec bypass -command ". 'C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1'"

Opens the Exchange Management Shell fine: http://tinypic.com/r/2dglulf/8

A:

I'm guessing this script isn't signed. Have you enabled execution of unsigned scripts using the Set-ExecutionPolicy -ExecutionPolicy Unrestricted cmdlet?

A:

First, let me tell you how you would run the script from a task:
Program/script: 
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Add arguments (optional): 
-PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -command ". 'C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1'; &'Z:\Exchange Powershell\MailboxesApproachingOverQuota.ps1'"

Also note that, the user id you are using to run the script may need to be granted permissions on the local server.
update: Removed -noexit

