The Add-TeamUser cmdlet helps add a user to a team as its member or owner using PowerShell. The user is also added to the Microsoft 365 group that backs up the team.
1 Add-TeamUser -GroupId 31f1ff6c-d48c-4f8a-b2e1-abca7fd399df -User firstname.lastname@example.org
In this example, the user email@example.com is added to the team and the specified group.
This cmdlet removes a user from a team and its unified group. You can specify the role of the user as 'Member' or 'Owner'. If specified as 'Member', the user is completely removed from the team, even if he or she is a team owner. However if the role is specified as 'Owner' then the user is removed from the owner role but continues as a member of the team.
1 Remove-TeamUser -GroupId 31f1ff6c-d48c-4f8a-b2e1-abca7fd399df -User firstname.lastname@example.org -Role Owner
In this example, the user email@example.com is removed as an owner in the specified team but continues to be a member.
Working with PowerShell scripts can be error-prone as it involves complex scripting. It is also time-consuming as the changes take a while to reflect in the application.Though the command is executed immediately, one might need to keep the Microsoft Teams application open for at least an hour for the changes to be applied. M365 Manager Plus helps to simplify Teams management with its bulk management feature.
The user-friendly interface helps you add or remove users to teams in bulk by simply importing a CSV file. You can also create automated workflows in the tool to manage Teams. This will help save time and reduce your workload.
Steps to manage team members in bulk using M365 Manager Plus:
You can also team members by running a name search in the Modify Microsoft 365 Group Members task as shown below.
To know more about managing Microsoft Teams using M365 Manager Plus, click here.