Monthly number of sent and received emails in 250 'shared mailboxes'

Copper Contributor

Hi guys. We use Exchange Online - as the title says; I need to get the email count - sent and received, for a specific list of shared mailboxes around 250, the list is available in a csv file or spreadsheet. The count needs to be on a monthly basis(number of emails sent and received in any given month), going back to January 2021. I don't want a report for all mailboxes on our tenant as our tenant is huge, with over 100k users. What is the best way to achieve this?

250(number of mailboxes) * 15(months) * 2(sent & received) = 7500 - that's the number of separate content searches it would take to achieve this, which is a ridiculous number. Is there a more efficient way to do this? TIA.


For PowerShell bulk content searches -e.g. 7500, this is the recommended method by MS:

2 Replies
Good luck with that :)

None of the built-in tools (reports, message trace, reporting web service, etc) goes back that far, so you're indeed left with mining mailbox content. I'd strongly suggest you consider using an EWS or Graph API-based approach instead of Content searches, it will be much faster. There are readily available script samples to get the number of items within specific folders/over specific timeframe, find the one that best suits your needs and work with it.
It won't help you after the fact, but you need to predict your data requirements. I can show what my mail flow rules have been doing for the last year because I run statistics at the end of each week. If you want a quarterly picture of submissions, remediations or any other ephemeral statistic, your only option is to record it in preparation for the unknown day when you need it.