Managing email flow and security in an Exchange Online environment often requires looking beyond the graphical admin center. While the interface is intuitive for basic tasks, complex configurations like mail forwarding are where the true power of Exchange Online PowerShell comes to light. Leveraging cmdlets such as Get-Mailbox and Get-MailboxForwarding, administrators can achieve granular control over how emails are handled within their organization.
Understanding Mailbox Forwarding Mechanics
Before diving into the syntax, it is crucial to understand the distinction between different forwarding mechanisms. Exchange Online supports two primary methods: forwarding and redirecting. A standard forwarding rule copies the email to another recipient while keeping a copy in the original mailbox. In contrast, a redirect sends the message exclusively to the new recipient, effectively removing it from the sender's original destination. The Get-Mailbox command is the foundation for identifying which mailboxes hold these configurations.
Retrieving Basic Forwarding Information
The most straightforward approach to audit forwarding settings is by using Get-Mailbox in conjunction with specific properties. By selecting the appropriate parameters, administrators can generate a report of all mailboxes and their associated forwarding addresses. This method provides a high-level overview without delving into the more complex routing rules that might be in place.

Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, ForwardingSmtpAddress, DeliverToMailboxAndForward
Decoding the Parameters
The ForwardingSmtpAddress property will display the external or internal SMTP address where mail is being sent. If this field is null, it generally indicates that no simple forwarding address is configured. The DeliverToMailboxAndForward property is a Boolean flag; when set to True, it confirms that the rule is a copy-and-forward action rather than a pure redirect.
Identifying Complex Transport Rules
It is important to note that mailbox forwarding settings are distinct from transport rules. While Get-Mailbox reveals settings applied directly to the mailbox, organizations often utilize transport rules to manage forwarding based on content, sender, or recipient criteria. These rules are managed by the Get-TransportRule cmdlet and are essential for compliance and data loss prevention strategies.
Get-TransportRule | Where-Object { $_.ForwardTo -ne $null -or $_.RedirectTo -ne $null }
Evaluating Rule Logic
The command above filters transport rules that contain actual forwarding logic. Inspecting the ForwardTo and RedirectTo properties within the output allows administrators to verify that automated routing aligns with company policy. This is particularly vital for legal departments or industries with strict archival requirements.

Auditing for Security and Compliance
Security teams must regularly audit forwarding rules to ensure they do not inadvertently expose sensitive data. External forwarding addresses, in particular, pose a risk if they bypass internal encryption or archiving solutions. A robust audit script should differentiate between internal and external destinations and flag any unexpected addresses for review.
Automating the Workflow
To maintain a proactive security posture, these commands should be integrated into regular reporting schedules. By exporting the results to CSV files, security personnel can track changes over time and correlate forwarding activity with login or access logs. This transforms a simple diagnostic command into a powerful component of the organization's governance framework.























