Microsoft Teams
A Microsoft customizable chat-based workspace.
5,924 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I've been trying to put Teams channel to eDiscovery Hold(both mailbox and sharepoint) using PowerShell but I'm stuck so I would be really appreciated if I can get any help or suggestion on how to proceed with my script.
Basically the idea is, I will provide the either Private or Public Team Channel name at the begining of the script and it'll put everything on eDiscovery hold.
$UserEmail = "username@nam.com"
Connect-MicrosoftTeams
Get-Team -user $UserEmail
$Mailbox = Get-Mailbox | Where {$_.PrimarySmtpAddress -eq $UserEmail}
Get-UnifiedGroup | Where {(Get-UnifiedGroupLinks $_.Alias -LinkType Members).DistinguishedName -contains $mailbox.DistinguishedName}
Get-UnifiedGroup | select DisplayName, SharePointSiteUrl
Get-MailboxFolderStatistics -Identity "Office 365 Sandbox" -FolderScope ConversationHistory -IncludeOldestAndNewestItems | ?{$_.FolderType -eq "TeamChat"} | Format-Table Name, ItemsInFolder, NewestItemReceivedDate
Set-Mailbox -Identity "Office 365 Sandbox" -LitigationHoldEnabled $True -GroupMailbox
Thanks for the reply and Sound good. I’ll be waiting for you guys. Thanks
@Aase Nomad - Are you developing any Microsoft teams application?
Hi, not just Team but I trying develop most O365 applications using PowerShell. Btw just wondering when I might be hear back from you regarding the script so that I know when I should be expecting any updates?
@AaseNomad-We are mainly responsible for Microsoft Teams app development related issues.
For Microsoft Teams product issues/failures your tenant Admin can reach out to Microsoft 365 Product Support.
For general questions about Microsoft Teams please post your question on Microsoft Teams Community.
For questions related to Powershell https://techcommunity.microsoft.com/t5/powershell/ct-p/WindowsPowerShell
Sign in to comment