How to List Active and Inactive Shared Mailboxes in Exchange with PowerShell
Question details
The user needs to identify and list all shared mailboxes in Exchange Online, and determine which of them are actively used versus inactive.

- Product
- Exchange Online
- Device & OS
- not provided
- Scenario
- An administrator needs to audit shared mailboxes to review aliases, display names, permissions, and overall activity status using PowerShell commands.
- Observed behavior
- By default, PowerShell lists shared mailboxes, but it requires combining the mailbox data with sign-in and permission logs to accurately classify each as active or inactive.
Ensure you have the Exchange Online Management module installed in PowerShell and possess the necessary administrative privileges to run mailbox queries in your Microsoft 365 tenant.
List Shared Mailboxes and Check Activity via Exchange Online PowerShell
Run specific PowerShell cmdlets to retrieve all shared mailboxes, check their delegated permissions, and export the resulting data for activity analysis.
Because shared mailboxes do not have direct user logins, Exchange does not provide a simple 'active/inactive' property. You must first extract the mailbox list and their permissions, then cross-reference this data with recent activity logs.
Open PowerShell as an administrator and run the command 'Connect-ExchangeOnline' to authenticate with your administrator credentials.
Execute the command 'Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited | Select-Object Identity, Alias, DisplayName | Sort-Object DisplayName' to retrieve the basic list.
Use the 'Get-MailboxPermission' cmdlet against the retrieved mailboxes to identify delegated access, making sure to exclude built-in and system accounts.
Append '| Export-Csv -Path "C:\SharedMailboxes.csv" -NoTypeInformation' to your PowerShell script to save the generated list to a local file.
Open the exported CSV file in a spreadsheet application and cross-reference the accounts with Microsoft 365 sign-in logs or message trace data to manually classify each mailbox as active or inactive.

Analyze Exported Mailbox CSV Reports with WPS Office
While Exchange administration requires PowerShell, analyzing the exported CSV reports doesn't require an expensive Microsoft Excel subscription. WPS Office is a free, lightweight alternative perfect for opening, filtering, and managing your exported administrator data.
- 1. Open WPS Spreadsheet: Launch WPS Office and select the Spreadsheet application.
- 2. Import the CSV File: Go to Menu > Open and select the CSV file you exported from your Exchange PowerShell script.
- 3. Filter and Analyze: Highlight the data headers and use the Filter tool under the Data tab to sort the mailboxes by permissions or activity status.

Frequently Asked Questions
Why doesn't PowerShell show an 'active' status for shared mailboxes?
Shared mailboxes do not have a dedicated active or inactive property because users do not log into them directly. Activity is measured by delegates accessing the mailbox or mail routing through it, requiring admins to analyze sign-in or message trace logs instead.
How do I check who has access to a specific shared mailbox?
You can use the 'Get-MailboxPermission -Identity "MailboxName"' cmdlet in Exchange Online PowerShell. This will return a list of users or security groups that have delegated access rights to that specific mailbox.
Can I use a graphical interface instead of PowerShell to view shared mailboxes?
Yes, you can view a basic list of shared mailboxes in the Exchange admin center (EAC) under Recipients > Mailboxes, and then filtering by 'Shared mailbox'. However, PowerShell is recommended for bulk exporting and detailed permission analysis.




