Performing Operations for Teams by Using PowerShell
In this section, you will utilize the Teams PowerShell module to perform tasks associated with the lifecycle and governance of Teams. These actions could be automated based on things such as approval decisions or schedules. You will learn how to carry out the following specific actions using PowerShell:
- Create a team
- Add and remove a team member or owner
- Add and delete a team channel
- Delete and restore a team
- Archive and unarchive a team
Begin by opening PowerShell 7 or later as Administrator (right-click then select Run as administrator) and executing the Connect-MicrosoftTeams
command to log in as the tenant’s Administrator. It is assumed that you have already executed the Connect-MicrosoftTeams
command before proceeding with the examples provided in this section. Once you’ve connected, you can perform each of the tasks detailed in this section.