Skip to main content

Quarantine toolkit

All commands require an active EXO session (Test-EOLConnection is called internally). For complete and current details, run Get-Help <FunctionName> -Detailed.

Export-QuarantineEml

Fetch quarantined message(s) by MessageId or Identity, save as EML, optionally open, and optionally release to all recipients.

Syntax

Export-QuarantineEml [-MessageId <String[]>] [-Identity <String[]>] [-DestinationFolder <String>] [-OpenFile] [-ReleaseToAll] [-ReportFalsePositive]
ParameterDescriptionRequiredDefault
MessageIdMessageId with/without angle brackets.One of MessageId/Identity-
IdentityQuarantine Identity (e.g., GUID\GUID).One of MessageId/Identity-
DestinationFolderFolder for the EML file.NoCurrent directory
OpenFileOpen the file after saving.NoFalse
ReleaseToAllRelease to all recipients after export.NoFalse
ReportFalsePositiveAlso report as false positive on release.NoFalse

Example

Export-QuarantineEml -MessageId '20230617142935.F5B74194B266E458@contoso.com' `
-DestinationFolder C:\Temp\Quarantine `
-OpenFile -ReleaseToAll -ReportFalsePositive
# Export using an Identity (e.g., copied from Get-QuarantineMessage)
Export-QuarantineEml -Identity 'f3a3dda8-3f78-46c9-332b-08de38f41262\a94e1c02-1d07-7d44-fd2b-482688059fbb' `
-DestinationFolder C:\Temp\Quarantine

Get-QuarantineFrom

List quarantined messages by sender.

Syntax

Get-QuarantineFrom -SenderAddress <String[]> [-IncludeReleased]
ParameterDescriptionRequired
SenderAddressSender address(es). Pipeline accepted.Yes
IncludeReleasedInclude messages already released.No

Example

Get-QuarantineFrom -SenderAddress 'bad@contoso.com' -IncludeReleased

Get-QuarantineFromDomain

List quarantined messages by sender domain.

Syntax

Get-QuarantineFromDomain -SenderDomain <String[]> [-IncludeReleased]
ParameterDescriptionRequired
SenderDomainDomain(s) (e.g., contoso.com). Pipeline accepted.Yes
IncludeReleasedInclude messages already released.No

Example

Get-QuarantineFromDomain -SenderDomain 'contoso.com'

Get-QuarantineToRelease

Pull quarantine items for a date range, optionally pick items via Out-GridView, export CSV/HTML, and release or delete in bulk.

Syntax

Get-QuarantineToRelease -Interval <Int> [-ChooseDayFromCalendar] [-GridView] [-Csv] [-Html]
[-OutputFolder <String>] [-ReleaseSelected] [-DeleteSelected] [-ReportFalsePositive]
ParameterDescriptionRequiredDefault
IntervalDays back to search (1-30).Yes (unless calendar)-
ChooseDayFromCalendarPick a single day via calendar UI.NoFalse
GridViewSelect items via Out-GridView.NoFalse
Csv / HtmlExport reports.NoFalse
OutputFolderTarget folder for CSV/HTML.NoCurrent directory
ReleaseSelected / DeleteSelectedRelease or delete selected items.NoFalse
ReportFalsePositiveAlso report as false positive when releasing.NoFalse

Example

Get-QuarantineToRelease -Interval 7 -GridView -ReleaseSelected -ReportFalsePositive

Unlock-QuarantineFrom

Bulk-release messages for specific senders (to all recipients, with optional false-positive report). Confirmation is controlled by SupportsShouldProcess; use -Confirm:$false when you want to suppress prompts.

Syntax

Unlock-QuarantineFrom -SenderAddress <String[]> [-ReportFalsePositive] [-Confirm]
ParameterDescriptionRequired
SenderAddressSender address(es). Pipeline accepted.Yes
ReportFalsePositiveAlso report as false positive.No

Example

Unlock-QuarantineFrom -SenderAddress 'sender@contoso.com' -ReportFalsePositive -Confirm:$false

Unlock-QuarantineMessageId

Bulk-release messages for specific message IDs or identities (to all recipients, with optional false-positive report). Confirmation is controlled by SupportsShouldProcess; use -Confirm:$false when you want to suppress prompts.

Syntax

Unlock-QuarantineMessageId [-MessageId <String[]>] [-Identity <String[]>] [-ReportFalsePositive] [-Confirm]
ParameterDescriptionRequired
MessageIdMessageId values (with/without angle brackets). Pipeline accepted.One of MessageId/Identity
IdentityQuarantine Identity values (e.g., GUID\GUID). Pipeline accepted.One of MessageId/Identity
ReportFalsePositiveAlso report as false positive.No

Example

Unlock-QuarantineMessageId -MessageId '20230617142935.F5B74194B266E458@contoso.com' -ReportFalsePositive -Confirm:$false
tip

Unlock-QuarantineMessageId is also available as qrel (alias).

Questions and answers

Is EXO required for quarantine functions?

Yes. Quarantine cmdlets call Test-EOLConnection and expect an active EXO session (Connect-EOL/Connect-Nebula).

How do I handle confirmations for destructive actions?

Cmdlets like Unlock-QuarantineFrom or Remove-MboxPermission support -Confirm:$false / -WhatIf via SupportsShouldProcess. Use them to automate or dry run.