I have a scheduled task setup to run once a month that use a script to get Mail Box information and push it out to a CSV file on a network share for reporting.
The Script executes correctly inside Power Shell, however when the task runs it simply Opens Notepad and display the script syntax.
Here is the script:
Get-MailboxStatistics -Server SERVERNAME | select-object DisplayName,TotalItemSize,ItemCount,StorageLimitStatus | export-Csv "T:\Rockbridge Network Documentation\50 Reporting\Email & Archiving\Monthly CSV File\data.csv"
Any idea why this works correctly when ran inside the shell but doesn't run at all when called from outside?