Hi @Vikram
I have found a script about how to get a list of all Teams with associated channels.
# Connect to Microsoft Teams
Connect-MicrosoftTeams
# List all Teams and all Channels
$ErrorActionPreference = "SilentlyContinue"
$allteams = Get-Team
$object = @()
foreach ($t in $allteams) {
$members = Get-TeamUser -GroupId $t.GroupId
$owner = Get-TeamUser -GroupId $t.GroupId -Role Owner
$channels = Get-TeamChannel -GroupId $t.GroupId
$object += New-Object -TypeName PSObject -Property ([ordered]@{
'Team'= $t.DisplayName
'GroupId' = $t.GroupId
'Owner' = $owner.User
'Members' = $members.user -join "`r`n"
'Channels' = $channels.displayname -join "`r`n"
})
}
Write-Output $object
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.