Create and manage retention policies
The volume and complexity of organizations' data is increasing daily—email, documents, instant messages, and more.
By default, Teams chat, channel, and files data are retained indefinitely, unless there's an attempt to delete the content via retention policies, user deletes, admin deletes and so on.
Retention policies and retention labels from Microsoft 365 help you to more effectively manage the information in your organization. Teams supports retention policies for chat and channel messages so that as an admin, you can decide proactively whether to retain this data, delete it, or retain it for a specific period of time and then delete it.
Retention locations
Retention policies can be applied to the following locations:
- Exchange mailboxes
- SharePoint classic and communication sites
- OneDrive accounts
- Microsoft 365 Group mailboxes & sites
- Skype for Business
- Exchange public folders
- Teams channel messages (standard channels and shared channels)
- Teams chats and Microsoft 365 Copilot interactions
- Teams private channel messages
- Viva Engage community messages
- Viva Engage user messages
You can efficiently apply a single policy to multiple locations, or to specific locations or users.
For the start of the retention period, you can choose when the content was created or, supported only for files and the SharePoint, OneDrive, and Microsoft 365 Groups locations, when the content was last modified.
Items inherit the retention settings from their container specified in the retention policy. If they are, then moved outside that container when the policy is configured to retain content, a copy of that item is retained in the workload's secured location. However, the retention settings don't travel with the content in its new location. If that's required, use retention labels instead of retention policies.
Although a retention policy can support multiple locations, you can't create a single retention policy that includes all the supported locations.
Teams requires a retention policy that's separate from other workloads. In other words, you have to create specific retention policies for Teams chats or channel messages.
You can apply a Teams retention policy to your entire organization.
You can configure unique policies that apply to specific users or teams in your organization.
You can also set up separate retention policies for private chats (1:1 or 1: many chats) and channel messages.
The followings are retention policy locations associated with Teams:
Teams channel messages: Message from standard channels or channel meeting messages. For Teams channel messages, you can select which teams the policy applies to.
Teams private channel messages: Messages from private channel chats and private channel meetings.
Teams chats: Private chats (1:1 chats) or group chats or impromptu meeting messages. For Teams chats, you can select which users the policy applies to.
Microsoft 365 groups: Teams is more than just chats and channel messages. If you have teams that were created from a Microsoft 365 group, you should additionally configure a retention policy to include that Microsoft 365 group. This retention policy applies to content in the group's mailbox, site, and files.
Skype for Business: If conversation history is turned on for Skype for Business and from the Skype for Business client side that history is being saved into a mailbox, that chat data isn't handled by a Teams retention policy. For this content, use a retention policy that's configured for Skype for Business.
SharePoint site: Files shared in channels are stored in the SharePoint site for the team.
OneDrive accounts: Files that are shared in chat are stored in the OneDrive account of the user who shared the file.
A retention policy applied to Microsoft 365 groups, SharePoint sites, or OneDrive accounts can delete files referenced in a Teams chat or channel message.
In this scenario, the file still displays in the Teams message, but they get a "File not found" error when users select the file. This behavior isn't specific to retention policies. It could also happen if a user manually deletes a file from SharePoint or OneDrive.
The retention policies applied to the user or group mailboxes in the Exchange or Microsoft 365 Groups locations don't affect Teams chat and channel messages. Even though Teams chat and channel messages are stored in Exchange, they're affected only by a retention policy applied to the Teams location.
Retention settings
By choosing the settings for retaining and deleting content, your policy for retention will have one of the following configurations for a specified period of time:
Retain-only:
For this configuration, choose the following options:
For retention policies: On the Decide if you want to retain content, delete it, or both page, select Retain items for a specific period, specify the retention period and then for At end of the retention period select Do nothing for the retention settings to be removed. Or to retain without an end date, select Retain items forever on this page.
For retention labels: On the Define label settings page, select Retain items indefinitely or for a specific period, and then:
- For the retention settings to no longer be in effect on the labeled content after a specific time: On the Define the retention period page, for Retain items for, specify the time period. Then on the Choose what happens after the retention period page, select Deactivate retention settings. The label remains on the content but with no restrictions, as if it's a label that just classifies. To retain without an end date: On the Define the retention period page, for Retain items for, select An indefinite period. The label remains on the content with any existing restrictions.
Retain and then delete:
For this configuration, choose the following options:
For retention policies: On the Decide if you want to retain content, delete it, or both page, select Retain items for a specific period, specify the retention period and then for At end of the retention period select Delete items automatically.
For retention labels: On the Define label settings page, select Retain items indefinitely or for a specific period, specify the retention period and then for Choose what happens after the retention period, select either Delete items automatically or Start a disposition review.
The principles of retention
You can apply more than one retention policy to the same content. Each retention policy can result in a retain action and a delete action. If you set up multiple Teams retention policies with different retention settings, the principles of retention resolve any conflicts.
Retention wins over deletion: Content won't be permanently deleted when it also has retention settings to retain it.
The longest retention period wins: If content is subject to multiple retention settings that retain content for different periods of time, the content will be retained until the end of the longest retention period.
Explicit wins over implicit for deletions: If a retention policy includes a specific location, such as a specific user’s mailbox or OneDrive for Business account, that policy takes precedence over another retention policy that applies to all users’ mailboxes or OneDrive for Business accounts but doesn’t specifically include that user’s mailbox.
The shortest deletion period wins: Similarly, if content is subject to multiple policies that delete content (with no retention), it will be deleted at the end of the shortest retention period.
Create a retention policy for Teams locations
To create and manage Teams retention policies, you can use the Microsoft Purview compliance portal or PowerShell. To create a retention policy for Teams chats and channel messages, use the following steps:
From the the Microsoft Purview compliance portal, select Data Lifecycle Management > Retention policies.
Select + New retention policy to start the Create retention policy wizard, and name your new retention policy.
Select Static from the Type page to choose locations containing the content you want to retain.
For the Choose locations to apply the policy page, select any or all of the locations for Teams. By default, all teams and all users are selected, but you can refine this setting by selecting the Choose and Exclude options.
Teams channel message: Messages from standard channel chats and standard channel meetings.
Teams chats: Messages from private 1:1 chats, group chats, and meeting chats.
Teams private channel messages: Messages from private channel chats and private channel meetings.
For Decide if you want to retain content, delete it, or both page of the wizard, specify the configuration options for retaining and deleting content. You can create a retention policy with the following options:
Retains content without deleting.
Retains and then deletes after a specified period of time.
Deletes content after a specified period of time.
Complete the wizard to save your settings.
Create a retention policy using PowerShell
To create and manage retention policies via Exchange PowerShell, you need to use the Security & Compliance PowerShell module. The following cmdlets are available for managing retention policies:
For more information, see:
Adaptive or static policy scopes for retention
When you create a retention policy or retention label policy, you must choose between adaptive and static to define the scope of the policy.
An adaptive scope uses a query that you specify, so the membership isn't static but dynamic by running daily against the attributes or properties that you specify for the selected locations. You can use multiple adaptive scopes with a single policy.
A static scope doesn't use queries and is limited in configuration in that it can apply to all instances for a specified location, or use inclusion and exclusions for specific instances for that location. These three choices are sometimes referred to as "org-wide", "includes", and "excludes" respectively.
Advantages of using adaptive scopes over static scopes:
No limits on the number of items per policy. Although adaptive policies are still subject to the maximum number of policies per tenant limitations, the more flexible configuration will likely result in far fewer policies.
You can apply specific retention settings to inactive mailboxes.
Advantages of using static scopes over adaptive scopes:
Simpler configuration if you want all instances automatically selected for a workload.
For "includes" and "excludes", this choice can be a simpler configuration initially if the numbers of instances that you have to specify are low and don't change. However, when these number of instances start to increase and you have frequent changes in your organization that require you to reconfigure your policies, adaptive scopes can be simpler to configure and easier to maintain.
For more information, see Learn about retention policies and retension labels