đź”§ New: User Management Graph PowerShell Toolkit

Simplify user tasks like bulk creation, updates, password resets, deletions, license checks & more — all from one place.

🚀 Launch Toolkit

Get-MailFlowStatusReport: Exchange PowerShell Cmdlet

The Get-MailFlowStatusReport cmdlet in Exchange Online PowerShell is used to retrieve mail flow statistics across your Microsoft 365 organization. It provides a summary view of the status of email delivery over a specified reporting period, showing details like: i)The number of messages sent and received, ii)Delivery status (success, deferred, failed), iii) Trends in mail flow volume, iv)Overall health of your mail transport service.

This cmdlet is especially useful for monitoring organizational email traffic and troubleshooting potential issues with mail delivery.

Notes: There’s no Microsoft Graph PowerShell equivalent for this report as of now. So you should use Exchange Online PowerShell.

Note: It’s a reporting cmdlet available only in Exchange Online (part of the reporting web service) and not in on-premises Exchange.


i) Cmdlet Syntax

Get-MailFlowStatusReport [-Direction <Inbound|Outbound|Internal>] [-StartDate <DateTime>] [-EndDate <DateTime>] [-EventType <GoodMail|Spam|Malware|Phish|Bulk|Other>] 

What it returns (summary counts may vary by tenant/reporting pipeline):

  • Successfully delivered mails
  • Blocked mails (e.g., Spam, Malware)
  • Delayed or failed mails

Common filters:

  • -Direction: Inbound (from outside), Outbound (to outside), Internal.
  • -StartDate / -EndDate: Pick a date window (≤ 90 days back).
  • -EventType: Focus on GoodMail/Spam/Malware/etc.

ii) Usage Examples

Example 1: Check Mail Flow Data Across Tenant

Get-MailFlowStatusReport

Example 2: Checking Outbound Mail Flow Data

Get-MailFlowStatusReport -Direction Outbound

Example 3: Checking Inbound Mail Flow Data

Get-MailFlowStatusReport -Direction Inbound

Tip: Add a date window to speed queries:

Get-MailFlowStatusReport -Direction Inbound -StartDate (Get-Date).AddDays(-7) -EndDate (Get-Date)

iii) Cmdlet Tips

  • Connect with the right role: Connect-ExchangeOnline using an account in View-Only Organization Management or Organization Management.
  • Narrow the scope: Always add -StartDate/-EndDate (e.g., last 7 or 14 days) for faster, clearer results.
  • Slice by direction: Start broad, then pivot with -Direction to isolate problem paths (Inbound vs. Outbound vs. Internal).
  • Focus on event types: Use -EventType (e.g., Spam, Malware) to confirm spikes or validate filtering efficacy.
  • Export for stakeholders:
  • Get-MailFlowStatusReport -StartDate (Get-Date).AddDays(-7) -EndDate (Get-Date) |
    Export-Csv .\mailflow-week.csv -NoTypeInformation
                                    
  • Correlate with tracing: If anomalies appear, pivot to Get-MessageTraceV2 / Get-MessageTraceDetailV2 for message-level proof.


iv) Possible Errors and Solutions

Error Cause Solution
The term 'Get-MailFlowStatusReport' is not recognized Not connected / old module Install/Update EXO V3 module; run Connect-ExchangeOnline.
Empty/partial results Window too broad or too old Use a tighter window; remember the 90-day limit.
Access denied Insufficient RBAC Use an account with View-Only Organization Management or Organization Management.
Slow query Large unbounded time range Add -StartDate/-EndDate and, if needed, filter -Direction/-EventType.
Unexpected counts Time zone confusion Normalize to the same time zone when comparing dashboards/reports.

vi) Conclusion

Get-MailFlowStatusReport gives you a quick, high-level snapshot of mail health—deliveries, spam/malware blocks, delays, and failures—filtered by direction, event type, and date range (up to 90 days). Use it to confirm the service is healthy, detect spikes early, and guide deeper investigations with message trace when needed. And remember: for this visibility, Exchange Online PowerShell is the place to be—there’s no Graph PowerShell equivalent yet.


Graph PowerShell Explorer Widget

20 Graph PowerShell cmdlets with easily accessible "working" examples.


Permission Required

Example:


                


                


                

© m365corner.com. All Rights Reserved. Design by HTML Codex