> ## Documentation Index
> Fetch the complete documentation index at: https://ps365.clidsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get-ExAutoForwardedMail

> Get messages that were automatically forwarded to external recipients

# Get-ExAutoForwardedMail

## SYNOPSIS

Get messages that were automatically forwarded to external recipients

## SYNTAX

```powershell theme={null}
Get-ExAutoForwardedMail [[-SenderAddress] <string>] [[-Days] <int>]
 [-FailedOnly]
```

## 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

```powershell theme={null}
Get-ExAutoForwardedMail
```

Returns auto-forwarded messages from the last 10 days.

### EXAMPLE 2

```powershell theme={null}
Get-ExAutoForwardedMail -SenderAddress user@example.com -Days 3 -FailedOnly
```

Returns failed auto-forwarded messages sent by [user@example.com](mailto:user@example.com) in the last 3 days.

## PARAMETERS

### -Days

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

```yaml theme={null}
Type: System.Int32
DefaultValue: 10
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 1
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### -FailedOnly

Only return messages with a Failed status.

```yaml theme={null}
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### -SenderAddress

Only return messages sent by this address.

```yaml theme={null}
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### 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](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES

Sources:
[https://office365itpros.com/2020/11/12/microsoft-clamps-down-mail-forwarding-exchange-online/](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](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://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://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/](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](https://admin.cloud.microsoft/exchange?ref=/homepage#/reports/autoforwardedmessages)

## RELATED LINKS

* [https://ps365.clidsys.com/docs/commands/Get-ExAutoForwardedMail](https://ps365.clidsys.com/docs/commands/Get-ExAutoForwardedMail.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.