I have a powershell script running the following line of code:
$results = Get-MessageTrace -SenderAddress $senderEmail -StartDate $daysAgo -EndDate $todayDate
A new employee tries to run this and gets no results in the message trace. When we remove the -StartDate and -EndDate parameters shown below, it does get the expected results.
$results = Get-MessageTrace -SenderAddress $senderEmail
I would have expected the line with -StartDate and -EndDate to produce the same results as 3 other users, but when the problem user runs it, he gets zero results. Is there some sort of nuance to Get-MessageTrace?
I have had the user run it on my computer and it works. I have run the script on their computer and it failed, so that leads me to believe it is something with the local computer. We are running the script in VS Code. ExchangeOnlineManagement is installed and ExchangePowerShell also. I feel like I'm overlooking something.