MS Purview DLM: Powershell create retention policy for Private channels.

Sergio Londono 886 Reputation points
2023-06-28T14:48:08.94+00:00

Hello Team,

Microsoft Purview DLM support the creation of retention policies for Teams private channel in the GUI,
However, I tried to create this policy by Powershell but there is not command for private channel.

There are for chats and standard channels, but not for private channel.

https://learn.microsoft.com/en-us/powershell/module/exchange/new-retentioncompliancepolicy?view=exchange-ps

User's image

User's image

Powershell script to create the retention policy for chat and channels.

Dyou know how to create the DLM retention policy for private channels using PowerShell.

###########################################################################################
###5. DLM RetPol MST_Chats_AllUser 7yr Modified DoNothing###

$teamsChatname = "DLM RetPol MST_Chats_AllUser 7yr Modified DoNothing3"
$teamsChatnamerule = "DLM RetPol MST_Chats_AllUser 7yr Modified DoNothing3"
$teamsChatdescription = "Protect the messages and sharefiles when the users are using MIcrosoft teams Chat one-to-one or one-to-many. The messages are stored in EXO 'Recovery item Folder' sub-folder 'SubstratedHold' and the share files are stored in the sender oneDrive TEAMS Chat Messages Storage: 1:1, group and private: participant mailbox TEAMS Chat files 1:1 or group: Sender Onedrive TEAMS Standard channel Messages Storage: group mailbox TEAMS Standard channel Files Storage: Sharepoint Team Site TEAMS Private channel Files Storage: Sharepoint PrivateTeam Site"

 
# Create the Teams Only Policy
$teamsChatpolicy = New-RetentionCompliancePolicy `
    -Name $teamsChatname `
    -Comment $teamsChatdescription `
    -TeamsChatLocation All `
    -Enabled $False

# Create Teams Only Policy Rule
New-RetentionComplianceRule `
    -Name $teamsChatnamerule `
    -Policy $teamsChatpolicy.Id `
    -RetentionDuration 2555 `
    -RetentionComplianceAction Keep


###########################################################################################
###6. DLM RetPol MST_StandardChannel AllUser 7yr Modify DoNothing###

$teamsStdChannelname = "DLM RetPol MST_StandardChannel AllUser 7yr Modify DoNothing1"
$teamsStdChannelnamerule = "DLM RetPol MST_StandardChannel AllUser 7yr Modify DoNothing1"
$teamsStdChanneldescription = "This policy will protect the messages and files that end-users post in Microsoft Teams Standard Channels. the messages will be preserved in Recovery Item Folder and the shared files in SPO TEAMS Chat Messages Storage: 1:1, group and private: participant mailbox TEAMS Chat files 1:1 or group: Sender Onedrive TEAMS Standard channel Messages Storage: group mailbox TEAMS Standard channel Files Storage: Sharepoint Team Site TEAMS Private channel Files Storage: Sharepoint PrivateTeam Site"

 
# Create the Teams Only Policy
$teamsStdChannelpolicy = New-RetentionCompliancePolicy `
    -Name $teamsStdChannelname `
    -Comment $teamsStdChanneldescription `
    -TeamsChannelLocation All `
    -Enabled $False

# Create Teams Only Policy Rule
New-RetentionComplianceRule `
    -Name $teamsStdChannelnamerule `
    -Policy $teamsStdChannelpolicy.Id `
    -RetentionDuration 2555 `
    -RetentionComplianceAction Keep
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

Accepted answer
  1. Priscilla Soares | Escola São Domingos 400 Reputation points
    2023-06-29T20:05:58.65+00:00

    Currently, there is no specific PowerShell command available to create a Data Loss Prevention (DLP) retention policy for private channels in Microsoft Teams. The available PowerShell cmdlets, such as New-RetentionCompliancePolicy, are primarily focused on creating retention policies for chats and standard channels.

    To create a retention policy for private channels, you can use the Microsoft 365 Compliance Center or the Microsoft Teams Admin Center. Here's how you can create a retention policy for private channels using the Microsoft 365 Compliance Center:

    1. Go to the Microsoft 365 Compliance Center (https://compliance.microsoft.com) and sign in with your admin account.
    2. Navigate to "Information governance" and select "Retention" from the left-hand menu.
    3. Click on "Create" to create a new retention policy.
    4. Provide a name and description for the policy.
    5. In the "Locations" section, select "Microsoft Teams private channel" to include private channels in the policy.
    6. Configure the desired retention settings such as duration and actions.
    7. Save the policy.

    Once the retention policy is created, it will apply to the private channels in your Microsoft Teams environment.

    Please note that the ability to create retention policies for private channels may vary based on your Microsoft 365 subscription and the availability of certain features. It's always a good idea to check the official Microsoft documentation and consult with your Microsoft 365 administrator or Microsoft Support for the most up-to-date information and guidance specific to your environment.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.