The estimated reading time 1 minutes

bulk changes in Microsoft Teams via powershell

Having worked with teams for a while, it was inevitable that I had to make changes to my existing teams in terms of security and collaboration.
Since I do not want to click through every single team, I wrote a short script.
Of course you have to import the Powershell cmdlets first and set up the connection to Office 365.
See my previous article.

A little reminder:

Install-Module MicrosoftTeams -Verbose
Connect-MicrosoftTeams

Here is the little script:

$groupid = ((Get-Team).groupid)
ForEach ($id in $groupid){
  Set-TeamGuestSettings -GroupId "$id" -AllowCreateUpdateChannels "true" -AllowDeleteChannels "true"
  Set-TeamMemberSettings -GroupId "$id" -AllowDeleteChannels "true" 
}

Who wants to search for a certain string in the display name can use the following quatrain.

$groupid = ((Get-Team | Where-Object {$_.DisplayName -like "*team03*"}).groupid)
ForEach ($id in $groupid){
  Set-TeamGuestSettings -GroupId "$id" -AllowCreateUpdateChannels "true" -AllowDeleteChannels "true"
  Set-TeamMemberSettings -GroupId "$id" -AllowDeleteChannels "true" 
}

Have a look before the changes:

 

The Script.

After:

 

Changes in all teams can be made very easily with the help of Powershell.

Have fun.

 

Print Friendly, PDF & Email
  • Was this Helpful ?
  • yes   no