ExchangeOnline Powershell - Get-QuarantineMessage -ReleaseStatus Requested no results

Erin Martin 40 Reputation points

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 = ""

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 I have confirmed that there are emails with the release status of requested.


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