Forum Discussion
aasenomad
Feb 16, 2022Copper Contributor
How to put Teams Channel on eDiscovery Litigation hold?
I've been trying to work on a script that put Teams private and public channel on eDiscovery Litigation hold but not really sure how to proceed with my script so I would be really appreciated if I ca...
AndySvints
Feb 20, 2022Steel Contributor
Hello aasenomad ,
In your specific use case you need to enable Litigation hold in 3 different places:
- Group mailbox used for the team - to cover Team public channels
- 'Teams Chat' mailbox folder of private channel member - to cover Teams private channels
- SharePoint site used by the team - to cover file content
Based on the information mentioned above one of the possible approaches is:
#Enter Group Name
$TeamName="My Team"
#Get Team Group
$TeamGroup=Get-UnifiedGroup $TeamName
#Set Team mailbox on Litigation hold
Set-Mailbox -Identity $($TeamName.PrimarySMTPAddress) -LitigationHoldEnabled $true -GroupMailbox
#Get Teams Private Channels
$PrivateChannels=Get-TeamChannel -GroupId $($T.GroupId) | Where-Object {$_.MembershipType -eq "Private"}
#Get Private Channel members
foreach($c in $PrivateChannnels){
$Members=Get-TeamChannelUser -GroupId $($TeamGroup.GroupId) -DisplayName $($C.DisplayName)
#Set at least one member's mailbox on Litigation Hold
Set-Mailbox -Identity $($Members[0].User) -LitigationHoldEnabled $True
}
#Set Litigation Hold on Teams SharePoint Site
New-CaseHoldPolicy -Name "Regulation $TeamName" -Case "$TeamName Files Compliance" -SharePointLocation $($TeamGroup.SharePointSiteUrl)
PowerShell modules used: ExchangeOnlineManagement, MicrosoftTeams.
In order to make it more elegant and effective you can also create on Hold Policy for SharePoint Site, Group Team and specific folder in private channels mailboxes.
Hope that helps.