The command 'Export-QuarantineMessage' does not work | System.AggregateException

Anonymous
2023-07-03T10:58:10.9566667+00:00

Hello,
There is a recurring problem with the export operation, when I try to export some eml
I get the the following error:
Export-QuarantineMessage: |System.AggregateException|One or more errors occurred.
This happens in some emails and not all.

example:
$message = Get-QuarantineMessage -MessageId <message_id>
$eml = Export-QuarantineMessage -Identity $message.Identity
Export-QuarantineMessage: |System.AggregateException|One or more errors occurred.

in addition if I try to connect with RPS i got this error (on the same mail of course)
Export-QuarantineMessage: One or more errors occurred.

Can you please help me fix this? Is this a known problem?

Thanks,
Ben

Exchange Online
Exchange Online
A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yuki Sun-MSFT 41,451 Reputation points Moderator
    2023-07-04T05:32:04.8833333+00:00

    Hi @Anonymous ,

    Just tried running the command against one quarantined mail in my lab tenant but cannot replicate the error:
    User's image

    This happens in some emails and not all.

    Have you noticed if these mails in question have anything in common which differs them from the other normal mails?

    Besides, please try exporting one of the problematic emails from the Microsoft 365 Defender portal and see if it works:
    See: Download email from quarantine.
    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Bhardwaj Ramphal 0 Reputation points
    2024-04-23T04:16:25.1766667+00:00

    User's image

    If you get message 'User is not allowed to call Export-QuarantineMessage', please check if affected user has 'Global Reader' role assigned in AzureAD. If yes, check after activating the 'Global reader' role. Your AzureAD administrator has changed settings 'Global Reader Azure Role Assignment Change from Active to Eligible'.

    thank you!

    0 comments No comments

Your answer

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