When transitioning to Office 365 (or any other sort of cross-forest move), Forwarding Address information does not get preserved.  This script will allow you to back up both types of forwards (ForwardingAddress, which is a mail-enabled Exchange object and ForwardingSmtpAddress, which is a standard SMTP address), and then later restore or import them to target objects as standard SMTP forwards.

This script supports Exchange 2007-2016 and Exchange Online for Exporting, and Exchange 2010+/Exchange Online for Importing. For more information, please see https://www.undocumented-features.com/2018/09/13/forwarding-address-import-and-export/.

Update:

Previous Updates:

PowerShell
Edit|Remove
<# 
.SYNOPSIS 
Use to export/backup forwarding addresses from one environment and restore/ 
import into a target environment. 
 
.DESCRIPTION 
Use to export/backup forwarding addresses from one environment and restore/ 
import into a target environment.  This script captures two types of forwards: 
- Exchange Forwarding object: A mail-enabled Exchange object, such as a mailbox, 
  mail-enabled user, or mail contact. 
- Generic SMTP Forward: an SMTP address value that may be internal or external 
  to the organization. 
   
Forwards are imported/restored as Generic SMTP forwards in the target 
environment. 
 
.PARAMETER Domain 
Use to filter source objects based on SMTP suffix. 
 
.PARAMETER Filename 
Import or export filename. 
 
.PARAMETER Mode 
Export or Import. 
 
.EXAMPLE 
.\ForwardingExportImport.ps1 -Domain sub.contoso.com -Filename sub.contoso.com.csv -Mode Export 
Exports forwarding parameters for mailboxes in the sub.contoso.com domain to file sub.contoso.com.csv. 
 
.EXAMPLE 
.\ForwardingExportImport.ps1 -Filename sub.contoso.com.csv -Mode Import 
Imports forwarding parameters for mailboxes in the file sub.contoso.com.csv. 
 
.LINK 
https://gallery.technet.microsoft.com/Forwarding-Address-Import-5b3ead8e 
 
.NOTES 
- 2019-02-09    Updated line 72 to reflect missing -Filter parameter. 
- 2018-09-12    Updated cmdlet to use server side filter to speed up results. 
- 2018-04-05    Updated else {} statement to include DeliverToMailboxAndForward value. 
- 2017-11-21    Removed windows file dialog box and changed import/export to 
                parameter-based. 
                Combined separate Get/Set scripts into single script with export /  
                import capability. 
- 2015-02-19    Original release. 
#>