WWL Tenants - Terms of use
If you are being provided with a tenant as a part of an instructor-led training delivery, please note that the tenant is made available for the purpose of supporting the hands-on labs in the instructor-led training.
Tenants should not be shared or used for purposes outside of hands-on labs. The tenant used in this course is a trial tenant and cannot be used or accessed after the class is over and are not eligible for extension.
Tenants must not be converted to a paid subscription. Tenants obtained as a part of this course remain the property of Microsoft Corporation and we reserve the right to obtain access and repossess at any time.
Lab 3 - Exercise 1 - Configure retention policies
In this lab, you are Joni Sherman, a Compliance Administrator at Contoso Ltd. in Texas. Your task is to implement retention policies to comply with state regulations, which allow records to be deleted after three years. You'll configure various retention policies across the organization to ensure data is managed and retained according to these legal requirements.
Tasks:
- Create a company-wide retention policy
- Create a Teams retention policy with specific user selection
- Create a retention policy with PowerShell
- Create an adaptive retention policy for legal and retail documents
- Test the adaptive scope policy
Task 1 – Create a company-wide retention policy
In this task, you'll set up a company-wide retention policy that covers key Microsoft 365 locations, ensuring that all items are retained for three years in compliance with state laws.
-
Log into Client 1 VM (SC-400-CL1) as the SC-400-cl1\admin account.
-
In Microsoft Edge, navigate to
https://purview.microsoft.com
and log into the Microsoft Purview portal as Joni ShermanJoniS@WWLxZZZZZZ.onmicrosoft.com
(where ZZZZZZ is your unique tenant ID provided by your lab hosting provider). Joni's password was set in a previous exercise. -
Select Solutions then select Data Lifecycle Management.
-
On the Data Lifecycle Management page, on the left sidebar, expand Policies then select Retention policies.
-
On the Retention policies page, select + New retention policy.
-
On the Name your retention policy page, enter:
- Name:
Company wide
- Description:
All locations except for teams
- Name:
-
Select the Next button.
-
On the Policy Scope page select Next.
-
On the Choose the type of retention policy to create page, select Static then select Next.
-
In the Choose where to apply this policy these locations:
- Exchange mailboxes
- SharePoint classic and communication sites
- OneDrive accounts
- Microsoft 365 Group mailboxes & sites
-
Select Next.
-
On the Decide if you want to retain content, delete it, or both page, ensure these values are set for the retention configuration:
- Select Retain items for a specific period.
- Under Retain items for a specific period, select Custom from the dropdown list
- Change the years field to 3
- Start the retention period based on: When items were last modified
- At the end of the retention period: Delete items automatically
-
Select Next.
-
On the Review and finish page select Submit.
-
Once your policy is created select Done on the You successfully created a retention policy page.
You have successfully created a retention policy that retains items across key Microsoft 365 locations for three years from the date of last modification. This policy can take up to 24 hours to be applied in your tenant, but you can proceed to the next step.
Task 2 – Create a Teams retention policy with specific user selection
Next, you'll create a retention policy specifically for Microsoft Teams, applying it to channel messages and select user chats to manage their retention separately from other data. Your organization has decided that a limited number of users are required to have their Team chats require a retention period.
-
You should still be logged into Client 1 VM (SC-400-CL1) as the SC-400-cl1\admin account, and you should be logged into Microsoft Purview as Joni Sherman.
-
In Microsoft Edge, you should still be on the Retention policies page in the Microsoft Purview portal. If not, navigate to
https://purview.microsoft.com
, then select Solutions and select Data Lifecycle Management. Select Policies > Retention policies from the left sidebar. -
On the Retention policies page, select + New retention policy.
-
On the Name your retention policy page, enter:
- Name:
Teams Retention
- Description:
Retention for Teams locations
- Name:
-
Select Next.
-
On the Policy Scope page select Next.
-
On the Choose the type of retention policy to create page, select Static then select Next.
-
On the Choose locations to apply the policy page enable these locations:
- Teams channel messages
- Teams chats and Copilot interactions
- Leave all other locations disabled.
-
For the Teams chats and Copilot interactions location, select the Edit text link under All users
-
On the Teams chats and Copilot interactions flyout panel add users:
- Adele Vance
- Pradeep Gupta
Note: By adding these two users the setting for Included in Teams chats changes from All teams to 2 users.
-
Select Done at the bottom of the flyout panel.
-
Back on the Choose where to apply this policy page select Next.
-
On the Decide if you want to retain content, delete it, or both page, ensure these values are set for the retention configuration:
- Select Retain items for a specific period.
- Under Retain items for a specific period, select Custom from the dropdown list
- Change the years field to 3
- Start the retention period based on: When items were last modified
- At the end of the retention period: Delete items automatically
-
Select Next.
-
On the Review and finish page select Submit.
-
Once your policy is created select Done on the You successfully created a retention policy page.
-
Close the browser window.
You have successfully configured a retention policy for Microsoft Teams, ensuring that channel messages and specific user chats are retained for three years.
Task 3 – Create retention policy with PowerShell
In this task, you'll create the same retention policies using PowerShell, demonstrating how to automate the policy setup process.
-
Log into Client 1 VM (SC-400-CL1) as the SC-400-cl1\admin account.
-
Open an elevated PowerShell window by right clicking the Windows button in the task bar, then select Terminal (Admin). Select Yes if the User Account Control dialogue pops up.
-
Run the Connect-IPPSSession cmdlet to connect to the Security & Compliance Center in your tenant:
Connect-IPPSSession
-
When prompted with a sign in dialog box, sign in as MOD Administrator
admin@WWLxZZZZZZ.onmicrosoft.com
(where ZZZZZZ is your unique tenant ID provided by your lab hosting provider). Admin's password should be provided by your lab hosting provider. -
Run the New-RetentionCompliancePolicy cmdlet to create the first retention policy for all locations except teams:
New-RetentionCompliancePolicy -Name "Company Wide PS" -ExchangeLocation All -ModernGroupLocation All -SharePointLocation All -OneDriveLocation All
-
Run the New-RetentionComplianceRule cmdlet to set the retention period to 3 years, using days as units based on the date modified:
New-RetentionComplianceRule -Name "Company Wide PS Rule" -Policy "Company Wide PS" -RetentionDuration 1095 -ExpirationDateOption ModificationAgeInDays -RetentionComplianceAction Keep
-
Run the New-RetentionCompliancePolicy cmdlet to create the second retention policy for Teams locations:
New-RetentionCompliancePolicy -Name "Teams Retention PS" -TeamsChannelLocation All -TeamsChatLocation "Adele Vance", "Pradeep Gupta"
-
Run the New-RetentionComplianceRule cmdlet to set the retention period to 3 years, using days as units:
New-RetentionComplianceRule -Name "Teams Retention PS Rule" -Policy "Teams Retention PS" -RetentionDuration 1095 -RetentionComplianceAction Keep
-
Close the terminal window.
You have successfully created retention policies using PowerShell, mirroring the policies set up through the Microsoft Purview portal.