PowerShell » Get-MailboxStatistics

How to check inactive Exchange mailboxes using PowerShell scripts

Your download is in progress and it will be complete in just a few seconds! If you face any issues, download manually here
Stay informed about Exchange with
Exchange Reporter Plus
  • Please enter business email address
  •  
    By clicking 'Proceed to Download', you agree to processing of personal data according to the Privacy Policy. You can unsubscribe from our mails at anytime.

Exchange Online Reports

The Get-MailboxStatistics cmdlet in PowerShell is used by administrators to pinpoint mailboxes that have not been accessed for a prolonged period. The steps mentioned below can be used to check inactive Exchange mailboxes using Windows PowerShell. ManageEngine Exchange Reporter Plus, an extensive tool used for reporting, auditing, monitoring, and creating alerts for critical activities in your Exchange environment, can also be used for this purpose.

The following table is a comparison on how to check inactive mailboxes in Microsoft Exchange using Windows PowerShell and Exchange Reporter Plus.

Windows PowerShell

Steps to check inactive Exchange mailboxes using Windows PowerShell

  • Note down the required parameter (AddDays), where AddDays refers to the number of inactive days for a particular mailbox.
  • Execute the following PowerShell script with the required parameter and its value.
 Copied
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Where-Object {$_.Lastlogontime -lt (Get-Date).AddDays(-90)} | Select-Object DisplayName, LastLoggedOnUserAccount, LastLogonTime
Click to copy entire script

Exchange Reporter Plus

Steps to check inactive Exchange mailboxes using Exchange Reporter Plus

  • Log in to Exchange Reporter Plus and navigate to Reports > Exchange Server > Mailboxes > Account Status Reports.
  • Select the Exchange organization.
  • Select the Inactive Period.

Limitations of using Windows PowerShell to check inactive Exchange mailboxes

  • Administrators must have the following permissions if they wish to execute the above-mentioned PowerShell script.
    • Local Administrator rights
    • The Exchange Organization Management role
    • Remote PowerShell access
  • Only technicians with PowerShell expertise can execute these commands, and the time-consuming nature of PowerShell scripts can impact productivity.

Benefits of using Exchange Reporter Plus to check inactive Exchange mailboxes:

  • Eliminate Exchange privilege elevation: Delegate custom roles to technicians to fetch reports regarding your Exchange environment without the need to elevate technicians' native Exchange privileges.
  • Script-free reporting: Generate comprehensive reports on various aspects of your Exchange environment without the need to memorize or execute complex PowerShell scripts.
  • Over 450 intuitive reports: Generate comprehensive reports on all aspects of Exchange Server, Exchange Online, and Skype for Business. These reports can be exported as CSV, HTML, PDF, XLS, or XLSX files.
  • Customized audit profiles: Create actions that you want to audit, and schedule profiles to generate audit reports at regular intervals.
  • 24/7 endpoint and service monitoring: Monitor Exchange server services, databases, database availability groups, storage, and email queues to ensure a hassle-free environment.
  • Mailbox content search: Perform pattern- and keyword-based searches to find important information in your organization's mailboxes.
  • Real-time alerts: Configure alert profiles to receive immediate SMS or email notifications when a specific alert is triggered.
  • Exchange migration: Transfer emails, contacts, tasks, and calendars from Exchange Server to Exchange Online with ease.
A single pane of glass for Exchange Server Monitoring, Reporting and Auditing