How to Count Daily Emails in a Microsoft 365 Shared Mailbox
Question details
The user needs to generate a comprehensive daily report of incoming and outgoing messages (both internal and external) for a Microsoft 365 shared mailbox, overcoming standard automation limits.

- Product
- Microsoft 365 / Exchange Online
- Device & OS
- not provided
- Scenario
- Generating accurate daily email volume reports for shared organizational mailboxes.
- Observed behavior
- Standard retrieval methods, such as basic Power Automate flows, face pagination and query limits, preventing the complete retrieval and accurate counting of daily emails.
Ensure you have Exchange Administrator or Global Administrator permissions in your Microsoft 365 tenant, as querying complete mailbox statistics and running message traces requires elevated administrative privileges.
Use Exchange Online PowerShell (Recommended)
PowerShell provides the most reliable and unlimited way to query complete email traffic data, allowing you to filter by date and export the results for detailed analysis.
Using the Get-MessageTrace cmdlet is the preferred administrative method because it bypasses the UI limitations and standard API pagination limits.
Open PowerShell as an Administrator and run 'Connect-ExchangeOnline' to authenticate with your Microsoft 365 administrator credentials.
Execute the 'Get-MessageTrace' command, specifying the shared mailbox address with the '-RecipientAddress' or '-SenderAddress' parameters, and set the '-StartDate' and '-EndDate' to the desired 24-hour period.
Pipe the results to the 'Export-Csv' cmdlet to save the trace data locally (e.g., Get-MessageTrace ... | Export-Csv -Path 'C:\EmailReport.csv').

Run a Message Trace in the Exchange Admin Center
If you prefer a graphical interface over scripting, the Exchange Admin Center allows administrators to run detailed message traces and download the reports.
Configure Power Automate with Pagination Enabled
If you must automate the process using Power Automate, you must enable pagination to bypass the default limit of retrieved emails.
Analyze Your Exported Email Reports with WPS Office
Once you have exported your Microsoft 365 shared mailbox data to a CSV file using Message Trace or PowerShell, you need a powerful spreadsheet tool to filter, count, and format the results. WPS Office provides a lightweight, highly compatible, and completely free alternative to Microsoft Office, making it incredibly easy to analyze your message trace data.
- 1. Open your CSV Report: Launch WPS Spreadsheet and open the CSV file you exported from the Microsoft 365 message trace.
- 2. Apply Data Filters: Select the header row, navigate to the Data tab, and click 'Filter' to easily sort through sender and recipient domains.
- 3. Create a PivotTable: Go to the Insert tab and select 'PivotTable' to quickly generate a summary count of daily internal and external emails.

Frequently Asked Questions
How long is message trace data available in Microsoft 365?
Standard message trace data is available for 10 days. If you need to search further back, you can request an extended historical message trace, which can retrieve data up to 90 days old.
How do I distinguish between internal and external emails in the exported report?
In your exported CSV report, look at the sender and recipient domains. If both domains match the accepted domains registered in your Microsoft 365 organization, the email is internal. If one of the domains belongs to an outside party, it is an external email.
Can a standard user count daily emails in a shared mailbox without admin rights?
Standard users cannot run organizational message traces or Exchange PowerShell commands. However, if they have Full Access permissions to the shared mailbox, they can manually search within Outlook or use Outlook rules to move and count incoming items.




