Apr 06 2022 07:07 AM
I would like to get a list of all private channels and their owners, is there a way to do it?
Thanks
Apr 06 2022 07:49 AM
Hello @Youness022
Did this quickly, it can be improved but it does what you want
Connect-MicrosoftTeams
$Teams = Get-Team
foreach($team in $teams){
$PrivateChannel=Get-TeamChannel -MembershipType private -GroupId $team.groupId
if($privateChannel)
{
Write-Host "Private Channel: " $privateChannel.displayName
$owner=Get-TeamChannelUser -Role owner -GroupId $team.groupId -DisplayName $privateChannel.displayName
Write-Host "Owner: " $owner.Name
}
}
Apr 18 2022 10:23 AM
Apr 18 2022 01:09 PM