Get-TransportServer mail1 | Get-MessageTrackingLog -Start “02/07/2019 00:00:00” -End “02/07/2019 08:00:59” -Eventid RECEIVE -ResultSize unlimited| Group-Object -Property Sender | Select-Object name,count | sort count -desc | ft –auto > C:\Temp\Receive.csv

Get-TransportServer mail1 | Get-MessageTrackingLog -Start “02/07/2019 00:00:00” -End “02/07/2019 08:00:59” -Eventid RECEIVE -ResultSize unlimited| Group-Object -Property Sender | Select-Object name,count | sort count -desc | ft –auto > C:\Temp\Send.csv

Another one

Get-Mailbox -resultsize unlimited | Sort-Object DisplayName| select DisplayName,PrimarySmtpAddress, @{label=”Received Items”;expression={(Get-TransportService | Get-MessageTrackingLog -Recipients $_.PrimarySmtpAddress -Start “<DateTime>” -End “<DateTime>” -EventId Deliver).count}}, @{label=”Sent Items”;expression={(Get-TransportService | Get-MessageTrackingLog -Sender $_.PrimarySmtpAddress -Start “<DateTime>” -End “<DateTime>” -EventId submit).count}} | Export-csv c:\emails.csv -NoTypeInformation

Leave a Reply

Your email address will not be published. Required fields are marked *