Forum Discussion

I-Use-a-PC's avatar
I-Use-a-PC
Copper Contributor
Apr 29, 2022

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

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:

https://docs.microsoft.com/en-us/microsoft-365/compliance/create-report-on-and-delete-multiple-content-searches?view=o365-worldwide

  • ExMSW4319's avatar
    ExMSW4319
    Steel Contributor
    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.
  • 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.

Resources