Understand how many emails have been sent or received by an Exchange Online Mailbox using Powershell

So had a bit of a weird question today from a colleague, who wanted a quick way to find out how many emails have been sent or received by an individual mailbox.

So Windows PowerShell to the rescue .. First of all you will need the ExchangeOnline module which can be easily installed via the following cmdlet

Install-Module -Name ExchangeOnlineManagement


Type Connect-ExchangeOnline and login using the relevant permissions

Received Message Count

# Receive Messages
$messages = Get-MessageTrace -RecipientAddress andrew.price@lyncme.co.uk -StartDate (Get-Date).AddDays(-1) -EndDate (Get-Date)

Sent Message Count

# Sent Messages
$messages1 = Get-MessageTrace -SenderAddress andrew.price@lyncme.co.uk -StartDate (Get-Date).AddDays(-1) -EndDate (Get-Date)

You will now get a number of received and sent messages.

The Author – Blogabout.Cloud

Leave a Reply

Your email address will not be published. Required fields are marked *