🎉 Our Office 365 Reporting Tool is now available in Azure Marketplace 🚀
This website uses cookies to improve your experience. We'll assume you're ok with this. Know more.
Exchange Online

How to Get Inactive Mailbox Report in Exchange Online

Not keeping tabs on Microsoft 365 inactive mailboxes can lead to severe security vulnerabilities, compliance gaps, and unnecessary licensing costs. However, no need to worry! We've got you covered with our practical solutions to find and manage inactive mailboxes in Exchange Online. Act now for a secure Exchange Online environment!

Using Exchange Online Admin Center

Microsoft 365 Permission Required
Global Admin or an Exchange Admin.
  • Login to the Exchange Online admin center.
  • Navigate to Recipients»Mailboxes. Click on the desired user.
  • Under the General tab, you can find the user's last logon time in Exchange Online.
Using Exchange Online Admin Center

Using Windows PowerShell

Microsoft 365 Permission Required
Global Admin or an Exchange Admin.
  • Connect to Exchange Online PowerShell using the below cmdlet.
  • Windows PowerShell Windows PowerShell
     Connect-ExchangeOnline -UserPrincipalName <UPN>
  • Run the below cmdlet to get inactive mailboxes using PowerShell. It provides various details like the user display name, last logon time, and users’ last activity time.
  • Windows PowerShell Windows PowerShell
     Get-Mailbox -ResultSize Unlimited | Foreach{Get-MailboxStatistics -Identity $_.UserPrincipalName | Select DisplayName,LastLogonTime,LastUserActionTime}
Using Windows PowerShell
  • Thus the 'Get-Mailbox' cmdlet has retrieved all the Exchange Online mailboxes with the user's activity time.

Using PowerShell Script

Microsoft 365 Permission Required
Global Admin or an Exchange Admin.
  • Do you feel it would be beneficial to obtain users' last logon time along with the number of inactive days? Here is a PowerShell script designed to find the last logon time in Exchange Online, including the duration of their inactivity.
  • Download and run the following script in the Administrator PowerShell.
Using PowerShell Script
UserLastActivityTimeReport.ps1

Track inactive Exchange Online mailboxes at ease!

The AdminDroid Exchange Online management tool helps you to find and manage inactive mailboxes in your Microsoft 365 environment by providing reports on mailbox usage, as well as information on holds and retention policies applied to them.

Mailbox Audit Logs in Microsoft 365

Keep an eye on mailbox owner access logs to find whether the mailboxes in your Exchange Online environment are being used regularly.

Check Login History in Exchange Online

Look into the mailbox login activities in your Microsoft 365 environment to prevent unauthorized access and meet compliance requirements.

Data Loss Prevention in Exchange Online

Easily monitor DLP policy matches to prevent leakage of sensitive information from Exchange Online mailboxes.

Microsoft 365 GDPR Compliance Management

Ensure that any personal information in inactive mailboxes is handled in compliance with GDPR requirements with AdminDroid.

Mailbox Usage Reports in Microsoft 365

Access comprehensive mailbox usage reports seamlessly from a centralized hub, thereby streamlining Exchange mailbox management.

Effortless Exchange Online Mailbox Management

Get a complete information of Exchange Online mailboxes in a single place and manage each mailbox activity in your organization.

AdminDroid transforms the intricate task of managing inactive mailboxes into a breeze for Exchange Online admins. Its sophisticated reporting capabilities empower you to take proactive measures, such as disabling mailboxes, assigning different retention policies, and restoring inactive mailboxes.

Explore a full range of reporting options

Important Tips

Find unused Exchange Online mailboxes and revoke their Microsoft 365 licenses, thereby enhancing resource allocation and improving security.

Audit the activities of enabling and disabling mailboxes to identify mailbox enabled users and disable them if they remain inactive for a prolonged period.

Find the inactive archived mailboxes in Exchange Online based on their last logon time and disable unnecessary archived mailboxes to prevent storage issues.

Common Errors and Resolution Steps

The following are the possible errors and troubleshooting hints while dealing with inactive mailboxes in Office 365.

Error Get-Mailbox: A parameter cannot be found that matches parameter name 'InactiveMailboxOnly'

This error occurs when you don’t have sufficient permission to read the inactive mailboxes in Exchange Online.

Fix Ask your Global Administrator to assign the "View-Only Recipients" role using the below cmdlet.
Add-RoleGroupMember -Identity "View-Only Recipients" -Member <UserDisplayName>

Error Exchange can't disable mailbox because it is on In-Place Hold.

This error occurs when you try to disable a mailbox configured with a retention policy.

Fix Run the below PowerShell cmdlet to remove the inactive mailbox from all the retention policies configured at the organization level.
Set-Mailbox <IdentityofInactiveMailbox> -ExcludeFromAllOrgHolds

Error Write-ErrorMessage : |Microsoft.Exchange.MailboxReplicationService.MailboxLacksArchivePermanentException|Mailbox '<User Guid>' has no archive

This error occurs if the target mailbox has a disabled archive while restoring an inactive archive mailbox.

Fix Run the below PowerShell cmdlet to enable archive for the target mailbox.
Enable-Mailbox -Identity <UserPrincipalName> -Archive

Error The term 'Get-Mailbox' is not recognized as the name of a cmdlet.

This error occurs when you have not connected to the Exchange Online PowerShell.

Fix Connect to the Exchange Online PowerShell using the below cmdlet.
Connect-ExchangeOnline -UserPrincipalName <YourAdminAccount>

Error Write-ErrorMessage : Ex6F9304|Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException|The operation couldn't be performed because object 'Exchange GUID' couldn't be found on 'SA9PR11A10DC003.NAMPR11A010.PROD.OUTLOOK.COM'

This error occurs when the Exchange GUID of the mailbox is wrong.

Fix Run the below cmdlet to get mailbox GUID using PowerShell.
Get-Mailbox -Identity <MailboxIdentity> | Format-List *GUID,MailboxLocations

Frequently Asked Questions

Find Inactive Mailboxes to Prevent Data Breaches in Microsoft 365

How to create an inactive mailbox in Microsoft 365?

How to create an inactive mailbox in Microsoft 365? +

Inactive mailboxes are used to retain former employee’s data to preserve sensitive information after they leave the Microsoft 365 organization.
You can create inactive mailboxes to retain mailbox content indefinitely by deleting the user account configured with Microsoft 365 retention policies or holds. Follow the steps below to configure the Microsoft 365 retention policy for an Exchange Online mailbox.

  • Login to the Microsoft 365 Purview portal. Navigate to Data lifecycle management»Microsoft 365.
  • Under the Retention policies tab, click on ‘+New retention policy’ to create a new Microsoft 365 retention policy.
  • Give a name for the retention policy and then select the administrative units that you’d like to apply to this policy.
  • You can choose either Adaptive or Static as per your requirement. If you choose Adaptive, then you must include the adaptive scopes to dynamically apply the policy. If you choose Static, then you can include only the desired mailboxes.
  • You can specify the retention settings like retaining items for a specific period, retaining items forever, and deleting items after a certain period, etc.
  • Review your settings and click on Submit. Now, the policy will be applied to the desired mailboxes.

After configuring the data retention policy for a user’s Exchange Online mailbox who is leaving your organization, you can delete the Microsoft 365 user account using PowerShell.

Remove-MgUser –UserId "<UserObjectID>"

How to identify the type of hold placed on an Exchange Online mailbox?

Using AdminDroid, you can check if a mailbox is on hold and remove unnecessary holds or retention policies before deleting a Microsoft 365 user account.

  • Here, you can get the entire details of the mailboxes on hold, such as primary SMTP address, mailbox size, inactive days, etc.
  • Pro Tip: Make use of the In-Place Holds easy filter to get all mailboxes on specific hold. You can also check Litigation hold status of a user’s Exchange Online mailbox and remove it if you are not willing to retain its contents.
mailbox-on-hold

How to restore an inactive mailbox in Microsoft 365?

How to restore an inactive mailbox in Microsoft 365? +

You can restore the inactive Exchange Online mailbox of an ex-employee and provide mailbox content access to other active users in your Microsoft 365 organization. Follow the steps below to restore an inactive mailbox in Office 365.

  • Connect to Exchange Online PowerShell using the below cmdlet.
    Connect-ExchangeOnline -UserPrincipalName <UPN>
  • Specify the mailbox to be restored in a separate variable.
    $inactiveMailbox = Get-Mailbox -InactiveMailboxOnly -Identity <ExchangeGuid of inactive mailbox>
  • Before restoring an inactive mailbox, it is mandatory to add the LegacyExchangeDN of the inactive mailbox as an X500 proxy address to the target mailbox. This helps in maintaining the proper routing of emails to the target mailbox.
    $inactiveMailbox.LegacyExchangeDN
    Set-Mailbox <ExchangeGuid of target mailbox> -EmailAddresses @{Add=X500:"<LegacyExchangeDN of inactive mailbox>"
  • Merge the contents of the inactive mailbox into the corresponding folders of the target mailbox using the below cmdlet.
    New-MailboxRestoreRequest -SourceMailbox $inactiveMailbox.DistinguishedName -TargetMailbox <ExchangeGuid of target mailbox>
  • Check the progress of the mailbox restore request to make sure it is completed successfully.
    Get-MailboxRestoreRequest | Select-Object DisplayName, Identity
    Get-MailboxRestoreRequest -Identity <Identity of the desired mailbox restore request>

Pro Tip: When an Exchange Online inactive mailbox is restored, only the contents are copied to another mailbox. However, it is still considered as an inactive mailbox and can be searched using eDiscovery.

Using AdminDroid, you can audit the mailbox restoration activities performed in your Exchange Online environment.

  • Here, you can get the details of the mailbox restoration activity, such as restored mailbox, restored time, and restored by.
  • You can get alerted whenever a new mailbox restore request is created by configuring an AdminDroid alert policy with filters.
  • Alert policies can be created from the Alerts tab of the AdminDroid portal.
mailbox-restore-alert

How to recover an inactive mailbox in Microsoft 365?

How to recover an inactive mailbox in Microsoft 365? +

You can recover a former employee’s inactive mailbox by granting access to a new Microsoft 365 user in your organization. This process converts the inactive mailbox into an active mailbox that contains all the recovered contents.

  • Connect to Exchange Online PowerShell using the below cmdlet.
    Connect-ExchangeOnline -UserPrincipalName <UPN>
  • Specify the mailbox to be recovered in a separate variable.
    $inactiveMailbox = Get-Mailbox -InactiveMailboxOnly -Identity <ExchangeGuidofInactiveMailbox>
  • Run the below cmdlet to convert the inactive mailbox into a new active mailbox in your organization.
    New-Mailbox -InactiveMailbox $InactiveMailbox.DistinguishedName -Name <Name> -FirstName <First name> -LastName <Last Name> -DisplayName "<Display Name>" -MicrosoftOnlineServicesID <User Principal Name> -Password (ConvertTo-SecureString -String '<Password>' -AsPlainText -Force) -ResetPasswordOnNextLogon $true

After recovering an inactive mailbox, a new Microsoft 365 user account is created in your organization. To activate this account, simply assign a license through your Microsoft 365 admin portal.


Note: When you recover an inactive mailbox, it gets completely converted to an active mailbox and is linked to a new user account. Subsequently, it is no longer classified as inactive.

How to find inactive mailboxes in Microsoft 365?

How to find inactive mailboxes in Microsoft 365? +

An Exchange Online mailbox can become inactive if a Microsoft 365 retention policy or hold is applied to it before deleting the user account. To manage these deleted mailboxes efficiently, get the Exchange Online inactive mailbox report and remove any holds or retention policies once the mailbox content is no longer required to be retained.

Get inactive mailbox from Microsoft Purview portal

  • Login to the Microsoft 365 Purview portal. Under Solutions, navigate to Data lifecycle management»Microsoft 365.
  • Under the Retention policies section, click on the Inactive mailbox tab to get a list of inactive mailboxes in Microsoft 365.

Get inactive mailbox using PowerShell

  • Run the below cmdlet to find the inactive mailbox report using PowerShell.
Get-Mailbox -InactiveMailboxOnly -ResultSize Unlimited | FT DisplayName,PrimarySMTPAddress,WhenSoftDeleted

With AdminDroid, you can easily find deleted mailboxes in Exchange Online and remove the retention policies or holds applied if you don’t need to retain their contents.

  • Here, you can get the entire details of the deleted mailboxes, such as deleted time, user display name, email address and performed delete action.
  • Pro Tip: Using the Column Customization feature, you can customize the report by adding various columns, such as Is Inactive Mailbox, In-Place Holds, and Litigation Hold. You can then decide to remove the holds on inactive mailboxes.
deleted-mailboxes

How to delete an inactive mailbox in Microsoft 365?

How to delete an inactive mailbox in Microsoft 365? +

Once you no longer require the contents of an inactive mailbox, you can permanently delete the mailbox by removing all holds on it. Subsequently, the inactive mailbox is automatically flagged for deletion and will be permanently removed after processing.


Before removing the holds, you must identify the type of hold placed on an Exchange Online mailbox. You can identify them by running the below cmdlets in your Exchange Online PowerShell.

Get-Mailbox -Identity <IdentityofInactiveMailbox> -InactiveMailboxOnly | FL DisplayName,Name,DistinguishedName,ExchangeGuid,IsInactiveMailbox,LitigationHoldEnabled,LitigationHoldDuration,LitigationHoldDate,LitigationHoldOwner,InPlaceHolds,ComplianceTagHoldApplied

Run the below PowerShell cmdlet to remove an inactive mailbox from a retention policy that is configured at the organization level.

Set-Mailbox <Identity of inactive mailbox> -ExcludeFromOrgHolds <Retention policy GUID without prefix or suffix>

You can also remove an inactive mailbox from all the retention policies configured at the organization level.

Set-Mailbox <Identity of inactive mailbox> -ExcludeFromAllOrgHolds

Run the below PowerShell cmdlet to remove an inactive mailbox from a retention policy configured for specific mailboxes.

Set-RetentionCompliancePolicy -Identity <Retention policy GUID without prefix or suffix> -RemoveExchangeLocation <Identity of inactive mailbox>

Run the below PowerShell cmdlet to remove a Litigation hold from an inactive mailbox.

Set-Mailbox -InactiveMailbox -Identity <Identity of inactive mailbox> -LitigationHoldEnabled $false


After removing the holds or retention policies on an inactive mailbox, it is considered a soft-deleted mailbox and is marked for permanent deletion after 30 days.

+

Kickstart Your Journey With
AdminDroid

Your Microsoft 365 Companion with Enormous Reporting Capabilities

Download Now
User Help Manuals Compliance Docs
x
Delivering Reports on Time
Want a desired Microsoft 365 reports every Monday morning? Ensure automated report distribution and timely delivery with AdminDroid's Scheduling to your email anytime you need.
Delivering Reports on Time
Schedule tailored reports to execute automatically at the time you set and deliver straight to the emails you choose. In addition, you can customize report columns and add inteligent filtering to the activities just from the previous day to suit your Microsoft 365 report requirements.
Set It, Schedule It, See Results- Your Reports, Your Way, On Your Time!
Time Saving
Automation
Customization
Intelligent Filtering
Give Just the Right Access to the Right People
Grant fine-tuned access to any Microsoft 365 user with AdminDroid’s Granular Delegation and meet your organization’s security and compliance requirements.
Give Just the Right Access to the Right People
Create custom roles loaded with just the right permissions and give access to admins or normal users within AdminDroid. The result? A streamlined Microsoft 365 management experience that aligns your organization's security protocols and saves your invaluable time and effort.
Align, Define, Simplify: AdminDroid's Granular Delegation
Smart Organizational Control
Effortless M365 Management
Simplified Access
Advanced Alerts at a Glance
Receive quick notifications for malicious Microsoft 365 activities. Engage with the AdminDroid’s real-time alert policies crafted to streamline your security investigations.
Advanced Alerts at a Glance
Stay informed of critical activities like suspicious emails and high-risk logins, bulk file sharing, etc. Through creating and validating ideal alert policies, AdminDroid provides a comprehensive approach to real-time monitoring and management of potential threats within your organization.
AdminDroid Keeps You Always Vigilant, Never Vulnerable!
Proactive Protection
Real-time Monitoring
Security Intelligence
Threat Detection
Merge the Required Data to One Place
Combine multiple required columns into one comprehensive report and prioritize the information that matters most to you with AdminDroid’s Advanced Column Customization.
Merge the Required Data to One Place
This column merging capability offers a flexible way to add different columns from various reports and collate all the essential data in one place. Want to revisit the customized report? Save it as a 'View’, and your unique report is ready whenever you need it.
Merge with Ease and Save as Views!
Custom Reporting
Unique View
Desired Columns
Easy Data Interpretation
Insightful Charts and Exclusive Dashboards
Get a quick and easy overview of your tenant's activity, identify potential problems, and take action to protect your data with AdminDroid’s Charts and Dashboards.
Insightful Charts and Exclusive Dashboards
With AdminDroid charts and dashboards, visualize your Microsoft 365 tenant in ways you've never thought possible. It's not just about viewing; it's about understanding, controlling, and transforming your Microsoft 365 environment.
Explore Your Microsoft 365 Tenant in a Whole New Way!
Executive overviews
Interactive insights
Decision-making
Data Visualization
Efficient Report Exporting for Microsoft 365
Downloading your reports in the right file format shouldn’t be a hassle with AdminDroid’s Report Export. Experience seamless report exporting in various formats that cater to your needs.
Efficient Report Exporting for Microsoft 365
Navigate through diverse options and export Microsoft 365 reports flawlessly in your desired file format. Tailor your reports precisely as you need them and save them directly to your computer.
Take Control, Customize and Deliver- Your Office 365 Data, Exported in Your Way!
Easy Export
Seamless Downloading
Data Control
Manage Microsoft 365

Get AdminDroid Office 365 Reporter Now!