Articles on: Scripts

Get the Team Owners For All The Teams Using PowerShell


This script is used to get details of all owner of the Teams


Get the credentials


 # Connect to Microsoft Teams 

Connect-MicrosoftTeams -Credential $credentials 

 # Get all the teams from tenant 


 # Loop through the teams 

foreach($team in $teamColl) 


    Write-Host -ForegroundColor Magenta "Getting all the owners from Team: " $team.DisplayName 

     # Get the team owners 

    $ownerColl= Get-TeamUser -GroupId $team.GroupId -Role Owner 

    #Loop through the owners 

    foreach($owner in $ownerColl) 


        Write-Host -ForegroundColor Yellow "User ID: " $owner.UserId "   User: " $owner.User  "   Name: " $owner.Name 



Updated on: 31/01/2023

Was this article helpful?

Share your feedback


Thank you!