New Location for Teams Compliance Records Breaks Scripts

Compliance Records Now Hidden in Non-IPM Section of Mailboxes

First reported by Jason Sherry, a very experienced ex-Exchange MVP, in a post to the Facebook Office 365 Technical Discussions group, Microsoft has changed the mailbox location where Teams stores its compliance records captured for personal chat and channel conversation messages. The change makes sense from Microsoft’s perspective even if it might cause some issues for tenants.

Uses of Teams Compliance Records

Originally introduced in April 2017, Teams compliance records are captured by the Microsoft 365 substrate and used for:

  • Retention processing. Retention policies act against the compliance records to allow tenants dictate how long Teams messages are retained.
  • eDiscovery and content searches. Because the compliance records are indexed along with other mailbox data, they are searchable and discoverable when tenants need to find information for investigations.
  • Communication compliance policies. The compliance records are scanned by agents to find potential violations of company communication policies such as threatening or abusive behavior.

Changing Storage for Teams Compliance Records

The compliance records are mail items stored in:

  • User mailboxes for personal and group chats, and channel conversations in private channels.
  • Group mailboxes for standard channel conversations.
  • Cloud-only (shard) mailboxes for messages sent by federated, hybrid, and guest users.

When Microsoft enabled compliance capture for Teams, they choose to store the records in the Team Chat sub-folder of the Conversation History folder. The folder name varies according to user language, but the folder type is always TeamChat, which makes the folder easy to find. The choice of location was logical at the time because Skype for Business Online stored its conversation transcripts in the Conversation History folder. However, unlike Conversation History, the Team Chat folder has never been accessible to clients like Outlook or OWA.

What’s changing is that Microsoft has relocated storage to a folder called TeamsMessagesData in the non-IPMRoot part of mailboxes. This is a more logical part of the mailbox to host the folder because it’s where system data is stored. Exchange Online and Microsoft 365 apps stash lots of information in mailboxes which email clients don’t see.

The Get-ExoMailboxFolderStatistics cmdlet reveals information about the folder:

# Report number of items in TeamsMessagesData folder
Get-ExoMailboxFolderStatistics -Identity Kim.Akers -IncludeOldestAndNewestItems -Folderscope nonipmroot| ? {$_.FolderType -eq "TeamsMessagesData" } | Format-List Name, ItemsInFolder, FolderType, NewestItemReceiveDate

Name                   : TeamsMessagesData
ItemsInFolder          : 65
FolderType             : TeamsMessagesData
NewestItemReceivedDate : 12/10/2020 21:32:20

Microsoft made the change to move creation of new Teams compliance records around 5 October 2020. For now, Teams compliance records exist in both the old and new locations. The plan of record is that a background process will move records from the Team Chat folder to TeamsMessagesData. No timeframe is available for when this might happen.

Update November 6: In my tenant the old compliance records have been moved to the new location.

Microsoft chose a similar location when Yammer networks began to generate compliance records, so it’s perfectly reasonable to move Teams compliance data to the same part of the mailbox.

The Downside of the Change

Microsoft didn’t communicate that the move would happen. In one respect, they had no need to do so through a notification posted in the Microsoft 365 message center. Compliance processing is a background task that tenants cannot control, so why should anyone need to know that a change happened?

The problem is that people use the presence of the Teams compliance records to know if teams are active. Although Microsoft would prefer tenants and ISVs like to use the Graph API to interact with Teams data(the User statistics script is an example of how to access Teams usage data with the Graph), in this instance, it’s easier to run a quick check using the Get-ExoMailboxFolderStatistics PowerShell cmdlet. You can still use the cmdlet to check the TeamsMessagesData folder, but access is slower because the FolderScope parameter doesn’t support a filter like the one available for Conversation History. Coders must therefore grab details of all non-IPM folders and then filter for TeamsMessagesData. As an example, the activity report script for Microsoft 365 Groups and Teams needed to be updated (V4.7 is now available).

Another unanticipated change is that backup products which purport to cover Teams by copying the compliance records along with other Exchange mailbox data must change their processing. They might not have realized that this problem exists and are therefore not copying the records today. All of which shows that you shouldn’t build a backup strategy based on data which might change. Then again, the lack of a scalable streaming API for Teams makes people do odd things.


A change like this which comes without warning is a great advertisement for an eBook. We cover Teams compliance processing in Chapter 12 and have updated the text for the November update for the Office 365 for IT Pros eBook. Do yourself a favor by benefiting from our work by subscribing to Office 365 for IT Pros.

8 Replies to “New Location for Teams Compliance Records Breaks Scripts”

  1. Awesome article. Do you know if each channel in a Team has its own folder in the TeamsMessageData folder? Reason why is we have a requirement from our Legal team to place a hold only on the chat for a particular channel, not every channel in the team. Thanks for any help with this!

    1. All the compliance records for all channels are combined in the single folder. You can’t apply a hold to a specific channel, just a team.

  2. Hola, estuve reHello I was trying to run the script but it tells me that it can not load the powershell online exchange connection module (I have it installed without problems on my computer) and still does nothing… what can it be?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.