Managing Exchange Online mailboxes efficiently often requires diving beyond the Outlook client and into the powerful capabilities of PowerShell. While the web interface is suitable for daily tasks, administrators need the granular control and automation potential that the Exchange Online PowerShell module provides. Specifically, when it comes to auditing security, troubleshooting email flow, or implementing compliance strategies, knowing how to list mailbox rules via PowerShell is an indispensable skill. This command-line approach offers a detailed, unfiltered view of the automated actions configured on any given mailbox.
Before you can query the settings, you must establish a remote session connected to Exchange Online. This initial step involves importing the necessary modules and providing credentials that have the appropriate administrative roles. Without this secure connection, the cmdlets designed to interact with the mailboxes will fail to execute. Think of this as logging into the administrative backend of your email infrastructure, but through a secure, text-based interface that allows for deeper inspection.
Understanding Mailbox Rules in Exchange Online
Mailbox rules, often referred to as Inbox rules, are the automated agents running within Exchange Online to process incoming messages. They perform actions such as moving emails to specific folders, flagging items, or redirecting messages based on specific conditions. While users frequently create these rules via Outlook, administrators must understand that these configurations are stored centrally on the server. This centralization means that PowerShell can access and modify these rules regardless of the client the user utilizes to view them.

Basic Syntax to List Rules
The primary cmdlet for retrieving these configurations is Get-InboxRule. To list mailbox rules for a specific user, you simply pipe the identity of the mailbox to this cmdlet. The command is straightforward, yet the output is rich with data, including the rule name, actions, conditions, and whether the rule is currently enabled. This direct approach saves time compared to clicking through multiple profiles in the Admin Center.
Here is the fundamental command structure you will use:
Get-InboxRule -Identity <MailboxIdentity>
Example: Targeting a Single User
To see the rules for a specific employee, you would replace the placeholder with their primary email address or user principal name. This is the most common scenario for an audit or troubleshooting session where a support ticket has identified a specific mailbox of concern.

Leveraging Piping for Bulk Analysis
PowerShell truly shines when you move from singular lookups to bulk administration. Instead of running the command for one user at a time, administrators can retrieve a list of all mailboxes and apply the Get-InboxRule cmdlet to each one. This is typically achieved by combining Get-Mailbox with Get-InboxRule using the pipeline functionality. The result is a comprehensive report of the entire organization's rule landscape.
Below is a sample workflow that collects rules from every mailbox and formats the output for easy review. This technique is vital for compliance teams ensuring that data handling policies are consistently applied across the enterprise.
Bulk Retrieval Example
| Command | Description |
|---|---|
Get-Mailbox -ResultSize Unlimited \| Get-InboxRule \| Select-Object Identity, Name, Enabled | Retrieves all mailboxes and lists their enabled rules with key identifiers. |
Filtering and Troubleshooting with PowerShell
When dealing with hundreds of mailboxes, the raw output can be overwhelming. To manage this, you can utilize standard PowerShell cmdlets like Where-Object to filter results based on specific criteria. For instance, you might want to find all rules that contain a specific keyword in the action, or identify rules that are currently disabled but were recently modified. This level of filtering transforms a massive data dump into actionable intelligence.

Moreover, understanding how to list mailbox rules helps in diagnosing complex email delivery issues. Sometimes, a message might be getting blocked or routed unexpectedly due to a hidden rule. By exporting the rule list to a text file or CSV, you can compare configurations between a "working" and a "broken" mailbox. This side-by-side analysis is often the fastest path to identifying the root cause of the problem.






















