How can I perform messagetrackinglog on indicated mailstore?

How can I perform messagetrackinglog on indicated mailstore?
 
Cuz that Get-MessageTrackingLog simply does not accept mailboxes/mailstore from the pipeline, so from my understanding, if we need to deal with the request, we have to :
1.       Get the mailbox list from the mailstore
2.       Loop all mail servers
3.       Get-messagetrackinglog on “receive” events for receipts on the list
4.       Get-messagetrackinglog on “send” events for sender on the list
5.       Then we need at least 3 times of loop on the query
6.       Still checking if more good and easy way…
Researched on Internet, not found any solutions...emm...just write up the below codes for initial addressing...
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
$users = "abc.def@xxx.com", "xyz@xxx.com"
@(foreach ( $userin $users){
 Get-MessageTrackingLog -server "mailserver" -EventID "RECEIVE" -Start "1/19/2009 1:18:00 PM" -End "1/20/2009 1:28:00 PM" -Recipients $user| select EventID, sender, timestamp, {$_.recipients}, messagesubject
 Get-MessageTrackingLog -server "mailserver" -EventID "SEND" -Start "1/18/2009 10:18:00 AM" -End "1/20/2009 1:28:00 PM" -sender $user| select EventID, sender, timestamp, {$_.recipients}, messagesubject
}) | Export-csv log.csv -notypeinformation -erroraction silentlycontinue
  • 收藏
  • 评论
  • 举报
提问和评论都可以,用心的回复会被更多人看到 评论
发布评论
相关文章