Blog Post

Exchange Team Blog
4 MIN READ

Troubleshooting Retention Policies in Exchange Online

The_Exchange_Team's avatar
The_Exchange_Team
Platinum Contributor
Feb 22, 2023

There are two types of retention policies: Exchange Online Retention policies and the Compliance Retention policies. In this two-part article series, I provide suggestions and tactics to help you troubleshoot both. In this post (Part 1), I delve into Exchange Online Retention Policies and identify issues that you may encounter. In Part 2, I discuss Compliance Retention policies and how to troubleshoot them.

You may not need them all, but in this article, I cover several useful troubleshooting steps.

Always start by using Start-ManagedFolderAssistant to begin processing mailboxes. While this can take up to 7 days in Exchange Online, it's important to start at the beginning and work to identify and fix the root cause. Also, if a problem does exist, it may be resolved after the Managed Folder Assistant (MFA) processes the mailbox.

A mailbox will not be processed if it is less than 10 MB in size or if no retention policy is assigned to it.

Identify the Exchange retention policy assigned to the mailbox

First determine which policy is assigned to the mailbox by running the following command:

 

Get-Mailbox <Identity> | fl InPlaceHolds, Retention*, ELC*

 

The Retention Policy applied to this mailbox, "Default MRM Policy," should be reviewed. Ensure that ELcProcessingDisabled is set to its default value of False, as this property prevents the MFA from processing the retention policy and other functions. Also, confirm that Retention hold is not enabled (False), as this will only prevent expiring items in folders from being visible to the user, but not in the Recoverable Items folder. For more information on Retention tags, policies and holds, see Retention tags and retention policies in Exchange Online.

Check the retention tags actions included in the policy

After reviewing the retention policy, determine which Retention tags have been assigned to the mailbox and what their actions are by running the following commands:

 

Get-RetentionPolicy -Identity “Default MRM Policy” | select -ExpandProperty retentionpolicytaglinks
$tags = Get-RetentionPolicy -Identity “Default MRM Policy” | select -ExpandProperty retentionpolicytaglinks
$tags | foreach {Get-RetentionPolicyTag $_ | ft Name, Type, Age*, Retention*}

 

The output above provides details about the retention policy applied to the mailbox, such as the types of included tags, the actions taken on items at a certain age, and the age limit for retention. It is important to evaluate the relevance of these tags to your mailbox and identify the default retention tag (DRT) applied to it.

Use MFA to process the mailbox again

To ensure the MFA processes the mailbox, run the following command after verifying that policies and tags have been correctly applied to the mailbox:

 

Start-ManagedFolderAssistant -Identity <User>

 

Again, the processing time in Exchange Online can be up to 7 days.

If you recently made changes to a mailbox's retention policy, use the -FullCrawl parameter to recalculate the entire mailbox:

 

Start-ManagedFolderAssistant -Identity <User> -FullCrawl

 

This parameter, which is available only in Exchange Online, will recalculate the application of tags throughout the entire mailbox.

Verify MFA processing

Check the value of ELCLastSuccessTimestamp to verify that the MFA correctly processed the mailbox by running the following command:

 

$MRMLogs = [xml] ((Export-MailboxDiagnosticLogs <user> -ExtendedProperties).mailboxlog)
$MRMLogs.Properties.MailboxTable.Property | ? {$_.Name -like “*ELC*”}

 

­The output will show the number of deleted or archived items that MRM processed last time as well as the time stamp of the last successful run.

Check MRM mailbox diagnostics

To further check for any MRM exceptions, run the following command:

 

Export-MailboxDiagnosticLogs <identity> -ComponentName MRM

 

If any errors are returned, such as "Resource 'DiskLatency (GUID:... Name:??? Volume:...) is unhealthy and should not be accessed" or "Resource 'Processor' is unhealthy and should not be accessed," determine the frequency of the error. If it has not occurred for more than two days, re-run the MFA. If the issue persists or has occurred for more than two days, contact Microsoft support. Additionally, you may want to review the compliance retention policy section of the relevant documentation.

Examine mailbox folder statistics

If the previous steps do not resolve the issue of the mailbox quota not being reduced, it may be necessary to check the mailbox folder statistics to identify the root cause of the problem. You can use the following command to gather information on the number of items, oldest item, and top item in the inbox folder:

 

Get-MailboxFolderStatistics <User> -FolderScope inbox -IncludeOldestAndNewestItems -IncludeAnalysis | select name, items*, oldes*, top*

 

If any item is larger than 150 MB, there will be a problem moving it to the archive, and you will have to move it manually or delete it. Also note that the maximum number of objects per folder is one million. If any folder reaches the 1 million item limit, nothing will be transferred to that folder. This is common for the Inbox, and when this happens, the ELC Assistant produces an error.

For example, a big item, like in the previous example, may cause the mailbox to stop processing, in which case you must manually move the item to the archive or delete it. Similarly, with the 1 million item restriction, you must manually reduce the number of items in the folder to allow MRM to handle the mailbox again.

That’s it for Part 1. In Part 2, I discuss troubleshooting Compliance Retention policies.

Mustafa Nassar
Exchange Support Engineer

Updated Feb 27, 2023
Version 2.0

9 Comments

  • CHEVALIER-INFO's avatar
    CHEVALIER-INFO
    Copper Contributor

    I wanted to add a point based on my experience with emails larger than 150MB that cannot be transferred.

    It is important to be mindful of the email size limits for sending and receiving. Currently, the limit is set at 150MB. Imagine you reduce this limit to 25MB. All the emails already present in the mailbox that are larger than 25MB will not be transferred by MFA.

    Therefore, in this case, you need to increase the limit back to 150MB (Set-Mailbox <user> –MaxSendSize 150mb –MaxReceiveSize 150mb), then rerun the command to force MFA (Start-ManagedFolderAssistant -Identity <User> -FullCrawl). I hope this can help someone.

  • Lyle Epstein's avatar
    Lyle Epstein
    Copper Contributor

    nhawk258  Thanks for the advice. I opened a ticket with support but they seem to doubt it is them and wanted me to manually move mail from the main mailbox to the archive to see if that works.... So basically they want me to be the manual MRM system? I don't think I am getting the Exchange PG support here with that suggestion. Further they told me if I move enough email from the primary box to the Archive things will just start working. That sounds like the biggest BS in the world.

     

    This is what I get with another user of the same tenant who's mailbox is 70GB full and Online Archive is 168GB (which must mean that the Expanding Archive has already kicked in since it is greater than 100GB)

     

    PS C:\scripts> Start-ManagedFolderAssistant b38f1dff-4d8a-4595-9268-85bfc5bffaf2 -FullCrawl
    PS C:\scripts> Export-MailboxDiagnosticLogs b38f1dff-4d8a-4595-9268-85bfc5bffaf2 -ComponentName MRM


    MailboxLog : 7/8/2023 8:15:41 AM;method:InvokeInternalAssistant;file:Substrate\sources\dev\MailboxAssistants\src\assis
    tants\ELC\ELCAssistant.cs:1109

    Exception:
    Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcEwsException: ELC EWS failed with error type:
    'FailedToUpdateUserConfiguration'. Message: ErrorInternalServerError : An internal server error
    occurred. The operation failed.
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcEwsClient.<>c.<UpdateMrmConfiguration>b__9_1
    (ResponseMessageType responseMessage, Int32 messageIndex)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcEwsClient.<>c__DisplayClass24_0.<CallEws>b__
    0(BaseResponseMessageType response)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcBaseServiceClient`2.InternalCallService[Base
    ResponseMessageType](Func`1 delegateServiceCall, Action`1 responseProcessor, Func`2 exceptionHandler,
    Func`1 authorizationHandler, Action`1 urlRedirectionHandler)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcEwsClient.CallEws(Func`1 delegateEwsCall,
    Func`3 responseMessageProcessor, Func`2 exceptionHandler, ExchangeVersionType requestServerVersion,
    String mailboxEmailAddress, String mailboxAuxMailbox)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcEwsClient.CallService(Func`1
    delegateEwsCall, Func`3 responseMessageProcessor, Func`2 exceptionHandler, String mailboxAuxMailbox)
    at
    Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcEwsClient.UpdateMrmConfiguration(BaseFolderIdType
    folderId, Byte[] userConfiguration)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.RemoteArchiveProcessorBase.SaveConfigItemInArch
    ive(Byte[] xmlData)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcUserTagInformation.SaveConfigItem(MailboxDat
    aForTags mailboxDataForTags, IAnalyticsClient analyticsClient)
    at
    Microsoft.Exchange.MailboxAssistants.Assistants.ELC.TagProvisioner.InvokeInternal(MailboxDataForTags
    mailboxDataForTags, IAnalyticsClient analyticsClient)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.TagProvisioner.Invoke(MailboxDataForTags
    mailboxDataForTags, IAnalyticsClient analyticsClient)
    at
    Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcTagSubAssistant.InvokeInternal(MailboxSession
    mailboxSession, MailboxDataForTags mailboxDataForTags, IAnalyticsClient analyticsClient)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcTagSubAssistant.Invoke(MailboxSession
    mailboxSession, MailboxDataForTags mailboxDataForTags, IAnalyticsClient analyticsClient)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ELCAssistant.InvokeCore(MailboxSession
    mailboxSession, List`1 customDataToLog, StatisticsLogEntry logEntry, ElcParameters parameters,
    IElcAssistantSnapshot snapshot, IAnalyticsClient elcAnalytics)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ELCAssistant.<>c__DisplayClass31_0.<InvokeInter
    nalAssistant>b__1()
    at Microsoft.Exchange.Common.IL.ILUtil.DoTryFilterCatch(Action tryDelegate, Func`2 filterDelegate,
    Action`1 catchDelegate)

    7/5/2023 7:12:16 AM;method:InvokeInternalAssistant;file:Substrate\sources\dev\MailboxAssistants\src\assis
    tants\ELC\ELCAssistant.cs:1109

    Exception:
    Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcEwsException: ELC EWS failed with error type:
    'FailedToUpdateUserConfiguration'. Message: ErrorInternalServerError : An internal server error
    occurred. The operation failed.
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcEwsClient.<>c.<UpdateMrmConfiguration>b__9_1
    (ResponseMessageType responseMessage, Int32 messageIndex)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcEwsClient.<>c__DisplayClass24_0.<CallEws>b__
    0(BaseResponseMessageType response)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcBaseServiceClient`2.InternalCallService[Base
    ResponseMessageType](Func`1 delegateServiceCall, Action`1 responseProcessor, Func`2 exceptionHandler,
    Func`1 authorizationHandler, Action`1 urlRedirectionHandler)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcEwsClient.CallEws(Func`1 delegateEwsCall,
    Func`3 responseMessageProcessor, Func`2 exceptionHandler, ExchangeVersionType requestServerVersion,
    String mailboxEmailAddress, String mailboxAuxMailbox)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcEwsClient.CallService(Func`1
    delegateEwsCall, Func`3 responseMessageProcessor, Func`2 exceptionHandler, String mailboxAuxMailbox)
    at
    Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcEwsClient.UpdateMrmConfiguration(BaseFolderIdType
    folderId, Byte[] userConfiguration)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.RemoteArchiveProcessorBase.SaveConfigItemInArch
    ive(Byte[] xmlData)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcUserTagInformation.SaveConfigItem(MailboxDat
    aForTags mailboxDataForTags, IAnalyticsClient analyticsClient)
    at
    Microsoft.Exchange.MailboxAssistants.Assistants.ELC.TagProvisioner.InvokeInternal(MailboxDataForTags
    mailboxDataForTags, IAnalyticsClient analyticsClient)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.TagProvisioner.Invoke(MailboxDataForTags
    mailboxDataForTags, IAnalyticsClient analyticsClient)
    at
    Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcTagSubAssistant.InvokeInternal(MailboxSession
    mailboxSession, MailboxDataForTags mailboxDataForTags, IAnalyticsClient analyticsClient)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcTagSubAssistant.Invoke(MailboxSession
    mailboxSession, MailboxDataForTags mailboxDataForTags, IAnalyticsClient analyticsClient)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ELCAssistant.InvokeCore(MailboxSession
    mailboxSession, List`1 customDataToLog, StatisticsLogEntry logEntry, ElcParameters parameters,
    IElcAssistantSnapshot snapshot, IAnalyticsClient elcAnalytics)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ELCAssistant.<>c__DisplayClass31_0.<InvokeInter
    nalAssistant>b__1()
    at Microsoft.Exchange.Common.IL.ILUtil.DoTryFilterCatch(Action tryDelegate, Func`2 filterDelegate,
    Action`1 catchDelegate)


    LogName : MRM
    Identity : 27c6b405-1051-42b6-b2cf-ff3b49bfe0be
    IsValid : True
    ObjectState : Unchanged

  • Lyle Epstein's avatar
    Lyle Epstein
    Copper Contributor

    What do you do if the Output of the mailboxdiagnosticlogs show the MailBoxLog has not run in almost a year (even though we have restarted the MRM with -fullcrawl) and you have an exception like below, note the date I run this is 11/23/2023 but it shows old log date.

     

    MailboxLog : 1/31/2023 5:52:09 PM;method:InvokeInternalAssistant;file:D:\dbs\sh\utff\0127_071253_0\cmd\1d\sources\Dev\
    MailboxAssistants\src\Assistants\ELC\ELCAssistant.cs:1098

    Exception:
    Microsoft.Exchange.WorkloadManagement.ResourceUnhealthyException: Resource
    'MdbAvailability(Guid:a1843c23-a540-4104-9dd7-ba8dc094cd62 Name:NAMPR06DG200-db101)' is unhealthy and
    shouldn't be accessed.
    at
    Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ELCHealthMonitor.InternalThrottleStoreCall(List`1
    archiveResourceDependencies)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcSubAssistant.ThrottleStoreCallAndCheckForShu
    tdown(IExchangePrincipal mailboxOwner, List`1 archiveResourceDependencies)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ExpirationTagEnforcer.<>c__DisplayClass46_0.<Co
    llectItemsMarkedForExpiration>b__0(IQueryResult queryResults)
    at Microsoft.Exchange.Data.Storage.AllItemsFolderHelper.RunQueryOnAllItemsFolder[T](IStoreSession
    session, QueryFilter queryFilter, SupportedSortBy supportedSortBy, DoQueryProcessing`1 queryProcessor,
    ICollection`1 properties, ItemQueryType itemQueryType)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ExpirationTagEnforcer.CollectItemsMarkedForExpi
    ration(IMailboxSession session)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ExpirationTagEnforcer.<>c__DisplayClass42_0.<Co
    llectItemsToExpire>b__0()
    at Microsoft.Mapi.ExRpcConnection.ExecuteWithPrivilege(ExRpcConnectionPrivilege privilege, Action
    action)
    at Microsoft.Mapi.MapiStore.ExecuteWithNonLocalReplicaAccess(Action action)
    at Microsoft.Exchange.Data.Storage.MapiAccessor.ExecuteWithNonLocalReplicaAccessElevation(Action
    actionDelegate)
    at Microsoft.Exchange.Data.Storage.StoreSession.ExecuteWithNonLocalReplicaAccessElevation(Action
    actionDelegate)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ExpirationTagEnforcer.CollectItemsToExpire(IMai
    lboxSession session)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ExpirationTagEnforcer.Invoke()
    at
    Microsoft.Exchange.MailboxAssistants.Assistants.ELC.TagEnforcerManager.InvokeInternal(MailboxDataForTags
    mailboxDataForTags, IAnalyticsClient analyticsClient)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.TagEnforcerManager.Invoke(MailboxDataForTags
    mailboxDataForTags, IAnalyticsClient analyticsClient)
    at
    Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcTagSubAssistant.InvokeInternal(MailboxSession
    mailboxSession, MailboxDataForTags mailboxDataForTags, IAnalyticsClient analyticsClient)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ElcTagSubAssistant.Invoke(MailboxSession
    mailboxSession, MailboxDataForTags mailboxDataForTags, IAnalyticsClient analyticsClient)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ELCAssistant.InvokeCore(MailboxSession
    mailboxSession, List`1 customDataToLog, StatisticsLogEntry logEntry, ElcParameters parameters,
    IElcAssistantSnapshot snapshot, IAnalyticsClient elcAnalytics)
    at Microsoft.Exchange.MailboxAssistants.Assistants.ELC.ELCAssistant.<>c__DisplayClass31_0.<InvokeInter
    nalAssistant>b__1()
    at Microsoft.Exchange.Common.IL.ILUtil.DoTryFilterCatch(Action tryDelegate, Func`2 filterDelegate,
    Action`1 catchDelegate)

     

    Lyle

  • Great Post ! One follow up question ...

    For the 'Policy Tip' in Outlook, Is there a threshold for when the 'Tip' is shown for Archive tags?



    Example: the Default MRM Policy has a 'Move To Archive after 2 Years' tag, When will Outlook show such notification? I know my above screenshot is a Delete tag 🙂

  • Brilliant document, thanks for sharing. This is indeed helpful checking the MRM Policies and Tags, but not yet why emails aren't getting retention labels from Microsoft Purview. Do you maybe have some guides / pointers to troubleshoot why emails aren't getting retention labels?

  • MikeCrowley's avatar
    MikeCrowley
    Iron Contributor

    I feel like when troubleshooting the ExO MFA, these are the words to live by:

     

     

  • nhawk258's avatar
    nhawk258
    Iron Contributor

    Great article! We've been having issues lately with MRM policies, excellent timing.