Find mailbox forwarding
Documentation: Microsoft Learn
Get-EXOMailbox runs with -PropertySets All so the forwarding attributes come back, since they sit outside the minimal default set this cmdlet returns.
The script
Script reader
Inspect before you run
Inspect the script below. It does not run in this browser.
Inspection only — no command has run.
Show reference output
Inspect this example’s structure
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-EXOMailbox -ResultSize Unlimited -PropertySets All | Where-Object ForwardingSmtpAddress | Select-Object DisplayName,PrimarySmtpAddress,ForwardingSmtpAddress- Stage 1Get-EXOMailbox
-ResultSize -PropertySets - Stage 2Where-Object
Positional values or no named parameters - Stage 3Select-Object
Positional values or no named parameters
How it works
Get-EXOMailbox runs with -PropertySets All so the forwarding attributes come back, since they sit outside the minimal default set this cmdlet returns. Where-Object keeps mailboxes with a populated ForwardingSmtpAddress, and the projection shows that destination next to the mailbox identity.
Adapting it
Check ForwardingAddress as well, which holds forwarding aimed at an internal recipient object, and add DeliverToMailboxAndForward to see whether a copy is still being kept in the original mailbox.
Requirements
ExchangeOnlineManagement module with a Connect-ExchangeOnline session.
If the result is unexpected
A mailbox forwarding report misses rule-based forwarding.
Mailbox forwarding properties and inbox rules are separate configuration mechanisms.
- Inspect the mailbox forwarding properties and check inbox rules separately for the same mailbox.
Validate the result
The report identifies which forwarding mechanism produced each finding.
Keep the check reliable
Include both mechanisms when the audit question is about all configured forwarding.