Quantcast
Channel: Exchange Server 2013 - General Discussion forum
Viewing all articles
Browse latest Browse all 4521

Run powershell script against exchange using task schedule

$
0
0

I want to run this using task scheduler

Get-MailboxStatistics -Server mailserver  | Select DisplayName, ItemCount, TotalItemSize | Sort-Object TotalItemSize -Descending | Export-CSV "\\pacetoputreport\report_$((Get-Date).ToString('MM-dd-yyyy')).csv"

I know I have to run some variation of this to launch the exchange module

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto"

How can I do this in Task Scheduler? I have tried numerous times using various combinations, but nothing seems to work.

Thank you


Viewing all articles
Browse latest Browse all 4521

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>