ExchangeOnline Powershell - Get-QuarantineMessage -ReleaseStatus Requested no results

Erin Martin 40 Reputation points
2024-05-24T18:56:18.4+00:00

I'm having a problem running a Get-QuarantineMessage Powershell script for ExchangeOnline in Powershell. My manager is able to run it connecting to the exact same account and get results. When I run it, I just get brought back to the prompt without any output.

#user notification area for modules``write-host -foreground yellow "Importing AD Module"

Import-Module ActiveDirectory

write-host -foreground yellow "Importing ExchangeOnlineManagement Module"

Import-Module -Name ExchangeOnlineManagement

#connection to exchange online here

write-host -foreground yellow "Connecting to ExchangeOnLine"

#$corpusername = $env:USERNAME

$corpusername = "test@email.com"

write-host -foreground yellow "Logging in as $corpusername"

Connect-ExchangeOnline -UserPrincipalName $corpusername -ShowBanner:$false -ShowProgress $true

#get the quarantined messages with a release status of requested, ignore all others

$qmsgs= Get-QuarantineMessage -ReleaseStatus Requested

What makes it confusing, is that I can run other Get-QuarantineMessage scripts and see results, such as:
Get-QuarantineMessage -StartReceivedDate 04/01/2024 -EndReceivedDate 04/30/2024

What could be the reason that my manager is able to run a script and get results, while I run it and get nothing? We are both successfully connecting to email@test.com. I have confirmed that there are emails with the release status of requested.

Thanks

Microsoft Exchange Online
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,592 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.