Avatar of Sys @dmin
Sys @dmin
Flag for Netherlands asked on

Exchange Online: Daily total count of in- and outbound mails being send by organization


We are currently using Office 365 E5 licenses and would like to recieve daily automated reports regarding our total send and received mails from our organization.

We tried varied scripts and read forum topics but it isn't exactly what we are looking for or are outdated PowerShell queries and third party tools which isn't a solution for our company.

We would like to receive the same statistics being used by the Microsoft Adminportal called Reports Usage for email activity. Unfortunately it is only possible to view the past 7, 30, 90 and 180 days and therefore isn't what we need.

For now we don't need statistics on user level but only organization wide. Furthermore we would like to have daily insights regarding send (outbound) and received (inbound) mails.

Admindroid isn't an option for us and also tried a script (https://gallery.technet.microsoft.com/office/Office-365-Mail-Traffic-afa37da1) but within a days range it doesn't collect the data well.

Does anyone else might have a solution regarding the above?

I would like to thank you in advance!

Kind Regards,
PowershellMicrosoft OfficeExchangeMicrosoft 365

Avatar of undefined
Last Comment
Sys @dmin

8/22/2022 - Mon

See the below link this should be what you are looking for. It will also give you the powershell cmdlets for the results. Its a simple cmdlet you can copy and paste. If you want this daily you will need to run it day or create a task to run the cmdlets daily.

Vasil Michev (MVP)

The report you are referring to can be accessed via the Graph API, so just use that. It does not however actually include all sent/received messages across your company. For those numbers you can use the corresponding report in the SCC (https://protection.office.com/reportv2?id=SentAndReceivedMailATP&pivot=EventType), which you can download or schedule, or you can use a PowerShell-based solution that gathers detailed info via the Get-MessageTrace cmdlet: https://gallery.technet.microsoft.com/office/Office-365-Mail-Traffic-afa37da1
Sys @dmin

@timgreen7077 thanks for your reply!

When I use the below CMDlet:
Get-MailTrafficReport -StartDate 03/23/2020 -EndDate 03/23/2020 -Direction Outbound -SummarizeBy Domain,EventType | Format-Table Domain,Date,MessageCount

Open in new window

I get the following result:
Domain Date               MessageCount
------ ----               ------------
       23-3-2020 00:00:00            1

A MessageCount of 1 for the Outbound mail isn't correct or am I using the CMDlet wrong?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Sys @dmin

Hi @Vasil Michev thanks for your fast reply!

I already used your secundairy link (https://gallery.technet.microsoft.com/office/Office-365-Mail-Traffic-afa37da1) and this is to much information for our needs at the moment.

Correct me if I'm wrong but you are saying that -when using your primairy link (https://protection.office.com/reportv2?id=SentAndReceivedMailATP&pivot=EventType) - we get the correct data by send and received mail for each day including SPAM, Malware and Good mail types. And if we are using the Graph API from the default usage report on the Admin Dashboard we only get the send and received mail which are marked as Good mail types from the past 7, 30, 90 and 180 days?
Vasil Michev (MVP)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

you need to set it for 24 hours so it would be start 3/22/2020 end 3/23/2020, or you can add the time with the date so -start 3/23/2020 12:01am -end 11:59pm
Sys @dmin

Hi timgreen and Vasil,

Thank you very much for your provided solutions, these will be sufficient for now!

Kind Regards,
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.