For administrators managing an Exchange environment, ensuring email flows securely and as intended is paramount. A common point of failure or misconfiguration lies in mailbox forwarding rules, which can be set by users or applications and sometimes operate outside of an IT department's awareness. Using PowerShell to check forwarding rules on mailbox provides a powerful, scriptable, and immediate way to audit these settings across your entire infrastructure.
Understanding Mailbox Forwarding in Exchange
Before diving into the cmdlets, it is essential to distinguish between the different types of forwarding in Exchange. AutoForward is a legacy feature typically set by MAPI applications like Outlook, where a rule is created to silently redirect a copy of incoming messages to another address without the sender's knowledge. In contrast, Inbox Rules configured through the Outlook client or OWA can move, delete, or forward messages, and these rules execute under the context of the authenticated user during client-side processing. Delegate access, another common feature, grants permissions to another user to manage mail on behalf of the owner, which is distinct from simple message redirection.
Retrieving Forwarding Settings with Get-Mailbox
The primary property for identifying high-level forwarding is the DeliverToMailboxAndForward setting. When this boolean is set to $true, it indicates that the mailbox is configured to deliver mail to the designated forwarding address in addition to the primary recipient. You can quickly audit this setting across all mailboxes using a simple query in the Exchange Management Shell.

Basic Audit Command
Running the following command retrieves all mailboxes where the delivery setting is enabled for forwarding, providing a snapshot of potential redirection points in your environment.
| Command |
|---|
Get-Mailbox -ResultSize Unlimited | Where-Object { $_.DeliverToMailboxAndForward -eq $true } | Select-Object DisplayName, Alias, DeliverToMailboxAndForward, ForwardingAddress |
Inspecting Specific Mailbox Rules with Get-InboxRule
While the mailbox-level property is useful, granular control often resides within Outlook Inbox Rules. These rules can perform complex logic, such as forwarding only emails from specific senders or with certain keywords. To inspect these, you must examine the rules associated with a specific user's mailbox.
Targeted Rule Inspection
The following command filters the rules for a specific user, identifying any that trigger a forward action. This is crucial for discovering shadow IT configurations or rules created by consultants that may no longer be documented.

| Command |
|---|
Get-InboxRule -Mailbox "username" | Where-Object { $null -ne $向前 } |
Exporting Results for Compliance and Reporting
In a regulated environment, maintaining an audit trail of mailbox configurations is a compliance requirement. Text output is insufficient for archival purposes; structured formats like CSV or JSON are necessary for integration with governance tools. The commands below demonstrate how to pipe the results of your investigation directly into a file for later review.
Generating a CSV Report
This command generates a detailed CSV file containing the display name, primary SMTP address, and forwarding status of every mailbox, providing a permanent record for your governance documentation.
| Command |
|---|
Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, PrimarySmtpAddress, DeliverToMailboxAndForward, ForwardingAddress | Export-Csv -Path "C:\Reports\ForwardingAudit.csv" -NoTypeInformation |
Troubleshooting Common Pitfalls
When executing these cmdlets, you might encounter performance issues or timeouts in large environments. The -ResultSize Unlimited parameter is critical to prevent paging issues, but in massive deployments, you may need to paginate the query using loops. Additionally, ensure your account running the script holds the necessary RBAC roles, specifically the View-Only Recipient role, to avoid access denied errors.

Automating Discovery with Scriptblocks
For ongoing monitoring, you can wrap the logic into a reusable script that accepts pipeline input. This allows you to target specific users or query all mailboxes dynamically. The script block below provides a robust method to check both the legacy AutoForward property and the modern Inbox Rules engine, returning a comprehensive view of potential message redirection.
| Script Logic |
|---|
Get-Mailbox -Identity $User | Select-Object @{N='ForwardingStatus';E={if($_.DeliverToMailboxAndForward){"Enabled" }else{"Disabled"}}}, @(Get-InboxRule -Mailbox $User | Where-Object {$_.ForwardTo -ne $null} | ForEach-Object { $_.Name }) -Join ', ' |






















