Managing Exchange Mailbox Rules with PowerShell

Automate Exchange Online inbox rules with PowerShell. Common pitfalls and solutions for admins.

Published 2025-06-18 by Josue Valentin

Managing mailbox inbox rules in Exchange Online with PowerShell can save admins time and ensure consistent configurations across users. However, certain quirks and errors frequently cause confusion.

Prerequisites

Connecting to Exchange Online

Install-Module -Name ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName [email protected]

Creating an Inbox Rule

# Forward emails from specific sender to another mailbox
New-InboxRule -Mailbox [email protected] \\
  -Name "Forward from VIP" \\
  -From "[email protected]" \\
  -ForwardTo "[email protected]"

Common Pitfalls

Viewing Existing Rules

Get-InboxRule -Mailbox [email protected] | Format-List Name, Priority, Enabled

Removing a Rule

Remove-InboxRule -Mailbox [email protected] -Identity "Rule Name"

For complex Exchange administration tasks, contact our team for assistance.