Office 365: Messages not deleting from my On-line Archive
If you have an Exchange On-line Archive tied to a On-Premises Mailbox you may notice that your MRM Polices are not firing like they should. Typically this is due to the fact that you have no imported your MRM Policies and Tags to Office 365 from your On-Premises environment. The way MRM works at a basic level is that each message gets stamped with the appropriate tags that are viewable with MFCMAPI (PR_POLICY_TAG, PR_ARCHIVE_TAG). The Managed Folder Assistant (MFA) is what is responsible for this process. So what happens is when MFA On-Premises runs and moves the messages to the archive mailbox to the Office 365. Now that the message lives in Office 365 it is up to the MFA running in Office 365 to manage the message. If the tag on the message does not reflect a tag that is present in Office 365 the MFA will ignore the message. To make sure that this step in TechNet: Export and import retention tags. Remember you will use Exchange Management Shell to export that MRM Polices and Tags and to import the MRM Polices and Tags to Office 365 you will need Remote PowerShell.
Export retention tags from an on-premises Exchange organization
Run this Exchange Management Shell command to change directory to the Scripts subdirectory in your Exchange installation path.
Cd "<Exchange Server installation path>\Scripts"
Run the Export-RetentionTags.ps1 script to export retention tags to an XML file.Important:
If you're importing or exporting retention tags and retention policies to Exchange Online, you must connect your Windows PowerShell session to Exchange Online. For details, see Connect to Exchange Online using remote PowerShell.
Export-RetentionTags.ps1 "c:\docs\ExportedRetentionTags.xml"
Import retention tags to an Exchange organization
Run this Shell command to change the directory to the Scripts subdirectory in your Exchange installation path
Cd "<Exchange Server installation path>\Scripts"
Run the Import-RetentionTags.ps1 script to import retention tags from a previously exported XML file.Important:
If you're importing or exporting retention tags and retention policies to Exchange Online, you must connect your Windows PowerShell session to Exchange Online. For details, see Connect to Exchange Online using remote PowerShell.
Note:
When running this script against Exchange Online, you may be prompted to confirm that you want to run software from an untrusted publisher. Verify that the name of the publisher appears as
CN=Microsoft Corporation, OU=MOPR, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
, and then click R to allow the script to be run once or A to always run.Import-RetentionTags.ps1 "c:\docs\ExportedRetentionTags.xml"