Hi all,
Can anybody suggest how to check IN and OUT mails of one month.
Example : I need to check total number of send and receive mails in our organization for the month of July for both internal and external domain.
Thanks,
Shabaz
Hi all,
Can anybody suggest how to check IN and OUT mails of one month.
Example : I need to check total number of send and receive mails in our organization for the month of July for both internal and external domain.
Thanks,
Shabaz
Hi,
Apart from the suggestion provided above, please try the script available in the below link which provides some additional information.
https://gallery.technet.microsoft.com/office/Total-Emails-Sent-and-c1daf5e7
Please Note: Exchange Q&A doesn't supported for development and writing of script, if you have this requirement, I would suggest you post it in stackoverflow forum or open a ticket to Microsoft, they will could help you writing script.
We can use Message Tracking log to check and count emails. Message tracking log only records emails within 30 days, you could use command below to check the setting of it:
Get-TransportService | fl name,MessageTrackingLogMaxAge
Then you could using those script to count the number of email:
$From = "8/1/2020"
$To = "8/31/2020"
$intSent = 0
$intRec = 0
$Mailboxes = Get-Mailbox -ResultSize unlimited | where {$_.RecipientTypeDetails -eq "UserMailbox"}
foreach ($Mailbox in $Mailboxes){
Get-TransportService | Get-MessageTrackingLog -Sender $Mailbox.PrimarySmtpAddress -ResultSize Unlimited -Start $From -End $To | ForEach {
If ($_.EventId -eq "RECEIVE" -and $_.Source -eq "SMTP") {
$intSent ++
}
}
Get-TransportService | Get-MessageTrackingLog -Recipients $Mailbox.PrimarySmtpAddress -ResultSize Unlimited -Start $From -End $To | ForEach {
If ($_.EventId -eq "DELIVER") {
$intRec ++
}
}
}
Write-Host "`nResult:`n--------------------`n"
Write-Host "Total Sent:"$intSent""
Write-Host "Total Receive:"$intRec""
Write-Host "`n--------------------`n"
If the response is helpful, please click "Accept Answer" and upvote it.
@ShabazAhmed-5117
Haven't received your update for a long time, any update about this thread now?
If the above suggestion helps, please be free to mark it as an answer for helping more people.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
7 people are following this question.