Set retention policy for Team chat and files using PowerShell

Tanmoy Das 801 Reputation points
2021-04-29T13:44:25.467+00:00

Hi,

How to set a retention policy for Team chats and files using PowerShell in Azure function app.

Thanks

Microsoft Defender for Cloud
Microsoft Defender for Cloud
An Azure service that provides threat protection for workloads running in Azure, on-premises, and in other clouds. Previously known as Azure Security Center and Azure Defender.
1,118 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 32,456 Reputation points Microsoft Employee
    2021-04-29T23:45:55.717+00:00

    The examples for setting a retention policy for Teams via Powershell are covered in this document:

    Set-RetentionCompliancePolicy  
       [-Identity] <PolicyIdParameter>  
       [-AddTeamsChannelLocation <MultiValuedProperty>]  
       [-AddTeamsChannelLocationException <MultiValuedProperty>]  
       [-AddTeamsChatLocation <MultiValuedProperty>]  
       [-AddTeamsChatLocationException <MultiValuedProperty>]  
       [-Comment <String>]  
       [-Confirm]  
       [-Enabled <Boolean>]  
       [-Force]  
       [-RemoveTeamsChannelLocation <MultiValuedProperty>]  
       [-RemoveTeamsChannelLocationException <MultiValuedProperty>]  
       [-RemoveTeamsChatLocation <MultiValuedProperty>]  
       [-RemoveTeamsChatLocationException <MultiValuedProperty>]  
       [-WhatIf]  
       [<CommonParameters>]  
    

    What is your goal with the function app? This blog post has an example that sets a timer triggered Powershell function, and it may be what you are looking for.