The PowerShell Module allows the IT professional to control Microsoft Teams by automating the creation of teams, channels, and settings within a team. Automating, simplifying, and streamlining daily tasks contributes to the success of Microsoft Teams within an organization.
Installing the Module from the PowerShell Gallery
1. As an Administrator, type PowerShell in the start menu. Right-click Windows PowerShell, then select Run as Administrator. Click Yes at the UAC prompt.
2. Type the following within PowerShell and then press Enter:
Install-Module MicrosoftTeams
3. Type Y at the prompt. Press Enter.
4. If you are prompted for an untrusted repository, then type A (Yes to All) and press Enter. The module will now install.
Once installed, you can now connect to Microsoft Teams.
Connecting to Microsoft Teams
1. Type the following and press Enter:
Connect-MicrosoftTeams
2. The Microsoft Teams PowerShell Cmdlets dialog box will now appear. Type in your Office 365 credentials. When done, press Enter.
3. The following will display once you are connected to the Microsoft Teams instant in your Office 365 tenant:
With these steps completed, you can now begin to run cmdlets, or scripts, against Microsoft Teams.
TIP: To see a full list of commands that are available, type Get-Command-Module MicrosoftTeams
In the following table, currently available commands in PowerShell are described below along with a brief description of what that command performs:
Command |
Description |
---|---|
Adds an owner or member to the Team |
|
Connect to the Microsoft Team based on the provided credentials |
|
Disconnect from the Microsoft Team |
|
Returns all the teams that the user belongs to |
|
Returns all the channels for a Team |
|
Returns a Team’s fun settings |
|
Returns Team guest settings |
|
Returns a list of commands for Microsoft Teams |
|
Returns Team member settings |
|
Returns Team messaging settings |
|
Returns all users from the Team |
|
Creates a new Team |
|
Add a new channel to the Team |
|
Deletes a Team |
|
Deletes a channel and this will not delete the content from associated tabs |
|
Remove an owner or member from the Team Last owner cannot be removed from the Team |
|
Updates Team properties |
|
Updates Team channel settings |
|
Update GIPHY, Stickers and Memes settings |
|
Updates Team guest settings |
|
Updates Team member settings |
|
Updates Team messaging settings |
|
Updates the Team picture |
It is important to remember that Teams use the same ID as the Office 365 Groups they are a part of and when creating a Team, a group is automatically created. However, an Office 365 Group does not, by default, create a Team.
Microsoft Teams and PowerShell provides tools for the IT professional resulting in simpler administration with the flexibility to customize controls accessible to the end-user, control over current and future governance of Microsoft Teams, and creative possibilities of standardizing Team settings, creating a self-service tool on the back-end for end-users to create Teams but with controls for IT and creating a *.csv file when creating large teams and/or adding numerous members to an existing Team.
Microsoft Teams and PowerShell combine to provide a rich and powerful tool for the IT professional.