Master Exchange Online PowerShell: View & Manage Mailbox Rules Efficiently

For administrators managing an Exchange Online environment, maintaining visibility and control over email flow is paramount. The ability to inspect and manage the automated processes that handle messages before they reach a user's inbox is a critical security and organizational function. Exchange Online PowerShell provides a direct, scriptable interface to view these configurations, allowing for precise auditing and troubleshooting. This guide focuses specifically on how to utilize PowerShell cmdlets to view mailbox rules, ensuring your message hygiene policies are transparent and verifiable.

Understanding Mailbox Rules in Exchange Online

Mailbox rules, often referred to as inbox rules, are the building blocks of automated email management. These scripts run on the server side, applying actions to incoming messages based on specified conditions. Conditions might include specific senders, keywords in the subject, or message headers, while actions can move emails to folders, mark them as important, or even delete them. Because these rules execute outside the user's immediate awareness, it is essential for IT professionals to have a methodical way to view and validate them to prevent misrouted critical communications.

Prerequisites for Remote PowerShell Access

Before you can view mailbox rules, you must establish a remote PowerShell session connected to the Security & Compliance Center. This requires a global administrator or compliance administrator account with the necessary permissions. First, ensure that the Exchange Online PowerShell V2 module is installed on your administrative workstation. You will then use the `Connect-ExchangeOnline` cmdlet, which prompts for credentials and establishes the secure session required to execute administrative cmdlets against your tenant.

9 Best Virtual Mailbox Providers to Use This Year
9 Best Virtual Mailbox Providers to Use This Year

Connecting to Exchange Online

To initiate the connection, open Windows PowerShell and execute the following command. The system will launch a remote authentication process, typically redirecting you to a web portal to input your credentials securely. Once authenticated, the session remains active, allowing you to run subsequent commands without re-authenticating for the duration of the session.

  • Connect-ExchangeOnline

Viewing All Mailbox Rules with Get-InboxRule

The primary cmdlet for auditing is Get-InboxRule. This command retrieves all active mailbox rules defined for a specific user's mailbox. By default, when executed without parameters against a connection, it will list the rules for the currently connected account. To view the rules for another specific user, you must utilize the -Mailbox parameter, specifying the user's primary email address or alias. This is essential during audits where you need to verify the configuration of high-privilege accounts or departments.

Basic Command Syntax

The fundamental syntax for viewing all rules is straightforward. Running the cmdlet without filters returns a concise object list containing the rule name, description, and whether it is enabled. For a more comprehensive view of the conditions and actions applied to each rule, you can pipe the output to the Format-List cmdlet, which expands the properties to show the full logic tree of each regulation.

a blue and white poster with the words azure cli commands on it's side
a blue and white poster with the words azure cli commands on it's side

  • View rules for the current user: Get-InboxRule
  • View rules for a specific user: Get-InboxRule -Mailbox "user@domain.com"
  • Detailed output: Get-InboxRule -Mailbox "user@domain.com" | Format-List *

Analyzing Rule Properties and Conditions

When you view the detailed output of a mailbox rule, you are presented with a structured list of properties that define its behavior. Key properties to scrutinize include Name, RuleIdentity, Enabled, Conditions, and Actions. The Conditions section reveals the logic that triggers the rule, such as FromAddressContainsWords or SubjectContainsWords. The Actions section details what happens if the conditions are met, such as MoveToFolder or DeleteMessage. Understanding these properties allows you to determine if a rule is functioning as intended or if it conflicts with organizational policy.

Troubleshooting Disabled or Missing Rules

There are scenarios where a rule might not appear in the Get-InboxRule output. If you are certain a rule exists but the cmdlet returns nothing, the rule might be disabled. By default, Get-InboxRule only returns enabled rules. To include disabled rules in your audit, you must add the -IncludeHidden parameter. Furthermore, certain built-in rules are hidden from general view for stability. To ensure you are seeing every configuration, combine the -IncludeHidden switch with the detailed list format to verify the true state of the mailbox.

Command to Retrieve Hidden Rules

Use the following command to ensure your audit is comprehensive and does not overlook inactive configurations that could be re-enabled in the future.

Unlocking the Mailbox Rule: What You Need to Know!
Unlocking the Mailbox Rule: What You Need to Know!

  • Get-InboxRule -Mailbox "user@domain.com" -IncludeHidden | Format-Table Name, Enabled -AutoSize

PO Box vs Virtual Mailbox – Why you might want one and how to get one!
PO Box vs Virtual Mailbox – Why you might want one and how to get one!
an info sheet with the words vlookup and indirects in green letters
an info sheet with the words vlookup and indirects in green letters
Virtual Mailbox Basics: How I Get Mail While I Travel Full-Time...
Virtual Mailbox Basics: How I Get Mail While I Travel Full-Time...
an email address is shown in the form of a mailbox
an email address is shown in the form of a mailbox
10 PowerShell commands that every Windows user should know
10 PowerShell commands that every Windows user should know
a computer screen showing the system's settings and instructions for using them on their laptops
a computer screen showing the system's settings and instructions for using them on their laptops
How to Tame Your Inbox with Apple Mail Rules
How to Tame Your Inbox with Apple Mail Rules
How to Create Rule in Outlook to move emails to New folder
How to Create Rule in Outlook to move emails to New folder
Everyone is using Claude Code. 
Almost nobody is using it properly.

Most developers:
→ Run random commands
→ Ignore CLAUDE .md
→ Treat it like a chat tool

Looks productive.
Wastes massive… | Vamsi Penmetsa
Everyone is using Claude Code. Almost nobody is using it properly. Most developers: → Run random commands → Ignore CLAUDE .md → Treat it like a chat tool Looks productive. Wastes massive… | Vamsi Penmetsa
Comment faire pour automatiquement les e-mails BCC à l'aide de règles dans Outlook
Comment faire pour automatiquement les e-mails BCC à l'aide de règles dans Outlook
Show or Hide Windows Updates using PowerShell in Windows 11/10
Show or Hide Windows Updates using PowerShell in Windows 11/10
a mailbox sitting on the side of a dirt road next to an empty field
a mailbox sitting on the side of a dirt road next to an empty field
How to send a copy of an email using a rule in Microsoft Outlook
How to send a copy of an email using a rule in Microsoft Outlook
the mailbox rental flyer is red and white
the mailbox rental flyer is red and white
What is USPS Form 1583 and Why Do You Need It For Your Virtual Mailbox?
What is USPS Form 1583 and Why Do You Need It For Your Virtual Mailbox?
the mailbox and box are labeled in two different languages
the mailbox and box are labeled in two different languages
a mailbox sitting on the side of a road
a mailbox sitting on the side of a road
How to Create, Manage & Change Inbox View in Outlook
How to Create, Manage & Change Inbox View in Outlook
an email form with the text'secure a free digital footprint '
an email form with the text'secure a free digital footprint '
USPS Priority Mail - Free Boxes, Sizes and Flat Rate
USPS Priority Mail - Free Boxes, Sizes and Flat Rate
a man looking through a hole with an envelope in front of him royalty illustration stock images
a man looking through a hole with an envelope in front of him royalty illustration stock images
Mailbox Template – Medium
Mailbox Template – Medium
13 Best Mailbox Ideas For You
13 Best Mailbox Ideas For You

Related Articles

Power Lineman Education Requirements Power Lineman Qualifications Electric Transformer Mailbox Mailbox Box Near Me Can You Lateral Pass To A Lineman Standard Mailbox Post Size Mailbox Post Height Requirements Lineman Max Salary Powershell Command To Check Hidden Rules On A Mailbox Mailbox Length In Feet