
Find Number of Emails Sent and Received by User in Office 365
As a Microsoft 365 admin, you must track users’ email activity to ensure secure communication. If you ever wonder how to find the number of emails sent and received by an individual mailbox, I can help you with the simple PowerShell cmdlets.
Most admins use ‘Get-MailTrafficReport’ and ‘Get-MailTrafficTopReport’ to identify per user mail traffic statistics. Due to Microsoft’s recent deprecation, these cmdlets will not work anymore. So, admins need to find the alternative cmdlet for ‘Get-MailTrafficReport’.
How to Get Office 365 Mail Traffic Statistics by User?
By using ‘Get-MailTrafficSummaryReport’, you can generate sent and received email reports for the past 90 days. I have given a few examples to view email statistics reports.
Note: You must connect to Exchange Online PowerShell to use the following cmdlet.
Get-MailTrafficSummaryReport –Category TopMailRecipient | Select C1,C2
The above cmdlet retrieves the number of emails received by the users for the last 15 days.
Here, C1 – Name of the mail recipient ; C2 – Number of emails received
- If you want to get Outlook email statistics per day or month, you can use the StartDate and EndDate parameters.
For example,
Get-MailTrafficSummaryReport –Category TopMailRecipient –StartDate “03/29/22 00:00:00” -EndDate “03/29/22 23:59:00” | Select C1,C2
It will show the list of mailboxes and the number of emails received by them on Mar 29, 2022.
- To get a monthly report on email traffic, you can use the following format.
Get-MailTrafficSummaryReport –Category TopMailRecipient –StartDate 03/1/22 -EndDate 3/31/22 | Select C1,C2
This example will retrieve the received email statistics for March’22.
- To get sent email statistics report, you can run the ‘Get-MailTrafficSummaryReport’ cmdlet with Category value TopMailSender. For example,
Get-MailTrafficSummaryReport –Category TopMailSender –StartDate 03/1/22 -EndDate 3/31/22 | Select C1,C2
Here, C1 – Identity of the mail sender ; C2- Number of emails sent
To get detailed reports on the number of emails sent and received per day, you can download the email traffic statistics PowerShell script.
Spam and Malware Reports
Also, you can generate spam and malware statistics reports using ‘Get-MailTrafficSummaryReport’.
- To identify users who received spam emails in the given period, run the cmdlet with the Category value TopSpamRecipient
Get-MailTrafficSummaryReport –Category TopSpamRecipient | Select C1,C2
Here, C1 – Spam recipient email address; C2 –Number of spam received
- To get the malware recipient stats, run the cmdlet with TopMalwareRecipient Category.
Get-MailTrafficSummaryReport –Category TopMalwareRecipient | Select C1,C2
Here, C1 – Malware recipient identity; C2 – Number of malware received
- To get a list of received malware, execute the cmdlet as follows.
Get-MailTrafficSummaryReport –Category TopMalware | Select C1,C2
Here, C1 – Malware name; C2 – Quantity of appearance
I hope this blog will help you get Office 365 email statistics reports and identify the mailboxes targeted by attackers.