Forum Discussion
PowerShell EXO: Get-MessageTrace still only 10 days back?
Hi,
For some time now, we can use the GUI to get realtime data for older than 10 days. I think we can now go 3 months back but only with a timeframe of 10 days.
Why doesn't this work with PowerShell? I've read the following news: Extended Query Range: Admins can query up to 90 days of historical data, but each query is limited to a 10-day range. Initially, only 30 days of historical data will be available for near real time queries, gradually increasing to the full 90-day range.
But everytime I try to get Get-MessageTrace going with, for example,
Get-MessageTrace -StartDate 04/22/2025 -EndDate 04/28/2025 -RecipientAddress email address removed for privacy reasons -Status DELIVERED -Sender $sender.PrimarySMTPAddress
I get the message "The StartDate can't be older than 10 days from today...." Why? It was so much easier with OnPrem environments. Now I have to start a historical search if I want to do some simple tracing and send a report with PowerShell? Not to mention that I don't even know if a generated report from Start-HistoricalSearch can be downloaded and sent with PowerShell. What am I missing?
2 Replies
I believe that's only for the "V2" cmdlet, and it's still not available via PowerShell. Keep an eye on this blog post: Announcing Public Preview of the New Message Trace in Exchange Online | Microsoft Community Hub
- Mister_XCopper Contributor
Thanks Vasil! That was the input I've needed. It's working now. I didn't realize that I have to use Get-MessageTraceV2 instead of Get-MessageTrace.