Create a company-wide team in Microsoft Teams using PowerShell

This training provides a PowerShell script that creates a public, company-wide team in Teams. The script uses the MicrosoftTeams PowerShell module (currently in beta) to create a public, company-wide team. It also uses the AzureAD PowerShell module to fetch the list of users in your tenant.

This is a great starting point if you want to dabble in some simple PowerShell commands and familiarize yourself with this powerful enterprise tool. PowerShell is a key component in management of other aspects of AzureAd Groups, including group-creation control - which is how to manage who can create a team in Teams.

⬇️ Get the PowerShell script

Important

This PowerShell script adds only the first 2500 members to a team. 2500 is the current team size limit.

This training is for IT admins or Teams users who want to automate team creation. You'll learn how to:

  • Install the relevant modules in PowerShell
  • Use the script

We won't cover these things:

  1. A deep dive into PowerShell. We only include the PowerShell information you need to get up and running with the PowerShell script. To learn more, start at Getting Started with Windows PowerShell
  2. The functionality of the AzureAD module. This PowerShell script uses the AzureAD module for a single command to fetch the users in the tenant.
  3. The cmdlets in the MicrosoftTeams module.
  4. A line-by-line walk-through of the PowerShell script.

To ask questions or send feedback about this training:

  • Post in the comments section at the bottom of the Next steps page of this tutorial.
  • To give us your product feedback, such as feature requests, go to UserVoice.