Link to home
Start Free TrialLog in
Avatar of Sys @dmin
Sys @dminFlag for Netherlands

asked on

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

Hi,

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,
Avatar of timgreen7077
timgreen7077

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.

https://docs.microsoft.com/en-us/powershell/module/exchange/reporting/get-mailtrafficreport?view=exchange-ps
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
Avatar of Sys @dmin

ASKER

@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?
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?
ASKER CERTIFIED SOLUTION
Avatar of Vasil Michev (MVP)
Vasil Michev (MVP)
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Hi timgreen and Vasil,

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

Kind Regards,