Skip to main content

Get-ExAutoForwardedMail

SYNOPSIS

Get messages that were automatically forwarded to external recipients

SYNTAX

DESCRIPTION

Checks the Remote Domain and outbound spam policy auto-forwarding settings, then searches the message trace (last 10 days max) for messages handled by an auto-forward or a recipient forward rule. Uses Get-MessageTraceV2 and Get-MessageTraceDetailV2 (ExchangeOnlineManagement 3.7.0 or later). Get-MessageTraceV2 returns 5000 messages at most, so the period is split into smaller time windows until each one fits. On a busy tenant this can be long: narrow the search with -SenderAddress or -Days. Message trace data is only available for the last 10 days. For older data, use Start-HistoricalSearch and Get-HistoricalSearch.

EXAMPLES

EXAMPLE 1

Returns auto-forwarded messages from the last 10 days.

EXAMPLE 2

Returns failed auto-forwarded messages sent by user@example.com in the last 3 days.

PARAMETERS

-Days

Number of days to search back (1 to 10). Default is 10.

-FailedOnly

Only return messages with a Failed status.

-SenderAddress

Only return messages sent by this address.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

Sources: https://office365itpros.com/2020/11/12/microsoft-clamps-down-mail-forwarding-exchange-online/ http://blog.icewolf.ch/archive/2020/10/06/how-to-control-the-many-ways-of-email-forwarding-in.aspx https://learn.microsoft.com/en-us/microsoft-365/security/office-365-security/external-email-forwarding https://techcommunity.microsoft.com/t5/exchange-team-blog/all-you-need-to-know-about-automatic-email-forwarding-in/ba-p/2074888 https://misstech.co.uk/2020/07/27/new-controls-available-to-block-automatic-email-forwarding/ Report: https://admin.cloud.microsoft/exchange?ref=/homepage#/reports/autoforwardedmessages