Make a member owner in all groups

%3CLINGO-SUB%20id%3D%22lingo-sub-1731824%22%20slang%3D%22en-US%22%3EMake%20a%20member%20owner%20in%20all%20groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1731824%22%20slang%3D%22en-US%22%3E%3CP%3Ei%20need%20your%20help%3C%2FP%3E%3CP%3Emy%20boss%20just%20asked%20me%20to%20add%20her%20to%20270%20groups%20as%20owner%20in%20microsoft%20teams.%3C%2FP%3E%3CP%3Eit%20will%20take%20me%20forever%20to%20do%20so.%20is%20there%20any%20easy%20way%20to%20do%20it%20using%20powershell%20or%20any%20idea%3C%2FP%3E%3CP%3Ethank%20you%20please%20i%20need%20help%20asap%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1731824%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1744455%22%20slang%3D%22en-US%22%3ERe%3A%20Make%20a%20member%20owner%20in%20all%20groups%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1744455%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F815466%22%20target%3D%22_blank%22%3E%40elie_t%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBelow%20PowerShell%20script%20will%20fetch%20the%20Microsoft%20Teams%20in%20your%20organization%20and%20adds%20user%20as%20owner%20to%20Teams%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fteams-powershell-install%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EInstall%20Microsoft%20Teams%20module%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fteams%2Fconnect-microsoftteams%3Fview%3Dteams-ps%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EConnect%20to%20Microsoft%20teams%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fteams%2Fadd-teamuser%3Fview%3Dteams-ps%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EAdd%20user%20to%20teams%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23%20Script%3C%2FP%3E%0A%3CP%3EConnect-MicrosoftTeams%3CBR%20%2F%3E%24teams%3DGet-Team%3CBR%20%2F%3Eforeach(%24team%20in%20%24teams)%3CBR%20%2F%3E%7B%3CBR%20%2F%3EAdd-TeamUser%20-GroupId%20%24team.Groupid%20-User%20%3CSTRING%3E%20-Role%20Owner%3CBR%20%2F%3E%7D%3C%2FSTRING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

i need your help

my boss just asked me to add her to 270 groups as owner in microsoft teams.

it will take me forever to do so. is there any easy way to do it using powershell or any idea

thank you please i need help asap

1 Reply

Hi @elie_t ,

 

Below PowerShell script will fetch the Microsoft Teams in your organization and adds user as owner to Teams  

Install Microsoft Teams module 

Connect to Microsoft teams 

Add user to teams 

 

# Script

Connect-MicrosoftTeams
$teams=Get-Team
foreach($team in $teams)
{
Add-TeamUser -GroupId $team.Groupid -User <String> -Role Owner
}