Simplify user tasks like bulk creation, updates, password resets, deletions, license checks & more — all from one place.
🚀 Launch ToolkitMicrosoft Exchange Online remains the preferred choice for many administrators when it comes to managing mail flow rules, even as Microsoft Graph PowerShell continues to evolve. In this article, we'll explore the Get-TransportRule cmdlet, which helps you retrieve and manage mail flow (transport) rules in your organization.
Before using Get-TransportRule, ensure you’ve installed and connected to Exchange Online PowerShell.
Install-Module -Name ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName admin@yourdomain.com
Get-TransportRule
You can optionally use:
Get-TransportRule [-Identity ] [-Filter ]
⚠️ Note: Only limited properties are supported in the -Filter parameter (see usage example below).
Get-TransportRule
Displays all mail flow rules configured in your Exchange Online environment.
Get-TransportRule | Where-Object {$_.State -eq "Enabled"}
Filters rules client-side based on their current state.
Get-TransportRule -Filter {Description -like "*external*"}
This retrieves rules that mention the word “external” in the rule’s conditions, actions or exception values.
Get-TransportRule | Select-Object Name, Priority, State
Error | Cause | Solution |
The search filter is invalid. | -Filter supports only Description parameter which accepts only the rule’s conditions, actions and exception values. | Use Where-Object for advanced filtering: Get-TransportRule | Where-Object {$_.State -eq "Enabled"} |
The term 'Get-TransportRule' is not recognized | Exchange module not installed or session not connected. | Run: Install-Module ExchangeOnlineManagement Connect-ExchangeOnline |
Access Denied | User lacks required permissions. | Ensure your account has the Mail Flow role in Exchange admin center. |
The Get-TransportRule cmdlet is a powerful tool for listing and filtering mail flow rules (transport rules) in Exchange Online. Whether you're auditing your ruleset, troubleshooting message delivery, or optimizing mail flow, this cmdlet provides vital visibility.
While Graph PowerShell is a promising modern interface, most admins continue to rely on Exchange Online PowerShell for mail flow rule management due to its completeness and stability.
© m365corner.com. All Rights Reserved. Design by HTML Codex