Forum Discussion

Mister_X's avatar
Mister_X
Copper Contributor
May 21, 2025

PowerShell EXO: Get-MessageTrace

Where is my thread that I've created 2 hours ago??

So, once again...: Since end of 2024, we can use the GUI (Exchange Online) to get realtime data within the last 90 days. Although just for a timespan of 10 days. 

Now, how does this work for PowerShell? The following had been stated: 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 whenever I use for example 

Get-MessageTrace -StartDate 04/10/2025 -EndDate 04/16/2025 -RecipientAddress email address removed for privacy reasons -Status DELIVERED -Sender $sender.PrimarySMTPAddress

It tells me "Invalid StartDate value. The StartDate can't be older than 10 days from today." So I'm confused. In the OnPrem evironments it was so much easier to generate a report from tracing and send it with PowerShell. Now I don't even know if it's possible to start a historical search and then send this report with PowerShell to a recipient. So can anyone please tell me how to use PowerShell to get 90 back without historical search? I need a report each month, so I will generate several traces with data from 8-9 days and append them until I have the month. Seems like it's the only way, but not even this seems to work. Help is appreciated, thanks!

No RepliesBe the first to reply

Resources