logo
search
Others

Get Recoverable Items Statistics for Exchange Online using PowerShell

Elise WilliamsElise Williams Oct 13, 2026 869 views

Question details

An administrator needs to retrieve folder statistics for the Recoverable Items folder across all cloud-only Exchange Online mailboxes.

How to Get Recoverable Items Statistics for Exchange Online Mailboxes
Product
Exchange Online
Device & OS
not provided
Scenario
Managing Microsoft 365 mailboxes and generating storage reports for Recoverable Items folders using automation.
Observed behavior
The administrator has an on-premises PowerShell script and wants to know if it will work unchanged for cloud-only mailboxes to extract item counts and sizes.
Before you start

Ensure you have the Exchange Online PowerShell module (V2 or V3) installed and possess Exchange Administrator or Global Administrator privileges in your Microsoft 365 tenant.

Solution 1Recommended

Use Exchange Online PowerShell to Retrieve Statistics

Connect to Exchange Online and utilize the Get-EXOMailboxFolderStatistics cmdlet to safely extract data for cloud-only mailboxes.

On-premises Exchange Server scripts generally cannot be used unchanged in a cloud environment. Attempting to use a standard remote PowerShell session to an on-premises server will fail to find cloud-only mailboxes. Instead, you must authenticate directly to Exchange Online and use the optimized Exchange Online cmdlets.

1
Connect to Exchange Online

Open PowerShell as an administrator and run 'Connect-ExchangeOnline' to authenticate with your administrator credentials.

2
Retrieve cloud mailboxes

Use the command '$Mailboxes = Get-EXOMailbox -ResultSize Unlimited' to gather all mailboxes in your tenant.

3
Query folder statistics

Loop through the collected mailboxes and run 'Get-EXOMailboxFolderStatistics -Identity $mailbox.UserPrincipalName -FolderScope RecoverableItems' to fetch specific metrics.

4
Export data to CSV

Pipe your collected data, including mailbox identity, item count, and folder size, into the 'Export-Csv' cmdlet to generate a spreadsheet-ready report file.

Use Exchange Online PowerShell to Retrieve Statistics
Cmdlet Performance: Always use Get-EXOMailbox and Get-EXOMailboxFolderStatistics instead of the older Get-Mailbox and Get-MailboxFolderStatistics cmdlets, as the EXO versions are significantly faster and more reliable for large cloud environments.
Free Microsoft Office alternative

Analyze Your Exported CSV Reports with WPS Office

While PowerShell helps you retrieve Exchange data, analyzing those exported CSV files requires a robust spreadsheet tool. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office for reviewing administrative logs and generating reports.

  1. 1. Download WPS Office: Install WPS Office for free on your operating system.
  2. 2. Open CSV Reports: Launch WPS Spreadsheets and open the CSV file generated by your Exchange Online PowerShell script.
  3. 3. Format and Analyze: Use built-in filters, pivot tables, and formatting tools to easily digest your Recoverable Items statistics.
Fully compatible with Microsoft Excel format to seamlessly open and analyze PowerShell CSV exports.Lightweight architecture ensures fast load times, even when opening massive mailbox statistic logs.Familiar user interface allowing administrators to manipulate data with zero learning curve.Completely free suite covering spreadsheets, documents, and presentations for IT documentation.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my on-premises Exchange PowerShell script fail in Exchange Online?

Exchange Online utilizes different connection endpoints and relies on optimized modules (like the EXO V3 module). On-premises scripts often use older cmdlets or attempt to connect to a local server, which cannot natively query cloud-only mailboxes.

Can I retrieve statistics for only specific mailboxes instead of all of them?

Yes. Instead of using '-ResultSize Unlimited', you can filter mailboxes using the '-Filter' parameter with Get-EXOMailbox, or pipe a specific list of user identities from a text file into your script loop.

What permissions do I need to run Get-EXOMailboxFolderStatistics?

You must be assigned appropriate administrator roles in Exchange Online, such as Organization Management, View-Only Organization Management, or Recipient Management, to retrieve folder statistics across the tenant.