Microsoft Teams – Deploying Teams at Scale

Hi All,
Greetings for the day!!!
Today discussing new feature related to Microsoft Teams – We could deploy multiple teams at a time in our Tenant and add / remove multiple users at a time to the team
This feature is useful when we need to create multiple teams at a time in our Tenant
Details
- Now, we can create maximum 500 teams at a time with PowerShell
- We can also add maximum 25 users at a time to a Team
- We have an also option to add / remove users from existing multiple teams at a time
- We have an option to set user as either Owner / Member to the team
- We have an option to select standard template or our custom template
- We will get an email notification for Teams creation completion / errors if any
- Team owners and members will be automatically notified

STEP 1 – Prepare Teams CSV file
- We need to create CSV file with team details which we need create with following columns
Column name | Description |
Team Name | Name of the Team |
Existing Team ID | This is require in case we are adding / removing users from existing team. Existing Team ID |
Visibility | Public OR Private |
Team Template ID | Template ID. This is not required field. If we need to create Team with standard template we can keep this field blank |

STEP 2 – Prepare Users CSV file
- We need to create CSV file with users details which we need to add / remove with following columns
Column name | Description |
---|---|
User Full Name | User display name |
User UPN or ID | User principal name (UPN) or ID |
Team Name | Team name |
ActionType | AddMember OR RemoveMember |
Owner or Member | Owner OR Member |

STEP 3 – PowerShell script
- Please note, we need 4.7.0 or later version of Microsoft Teams PowerShell module
- We could check which version of Microsoft Teams PowerShell module installed – we have detailed article for the same – https://knowledge-junction.in/2022/12/12/small-tips-and-tricks-how-to-know-the-version-of-any-installed-powershell-module-get-installedmodule/
- We can download latest version of Microsoft Teams PowerShell module from – https://www.powershellgallery.com/packages/MicrosoftTeams/4.9.1
- Connect to Microsoft Teams using – Connect-MicrosoftTeams
Connect-MicrosoftTeams
- Once we are connected to Microsoft Teams, we are ready to create Teams
- We have PowerShell CMDLET – New-CsBatchTeamsDeployment
PS C:\> New-CsBatchTeamsDeployment -TeamsFilePath
'C:\Prasham\Articles\Teams\deployteamsatscale\teams.csv'
-UsersFilePath
'C:\Prasham\Articles\Teams\deployteamsatscale\USERS.csv'
-UsersToNotify "prasham@knowledgejunction1.onmicrosoft.com"
Output -
The deployment job has been submitted. OrchestrationID: 1.wjp.3271ab97-c3bb-491d-b3f3-0aff1014187c.d0a0524c-e6f6-4252-b261-8e240c1a0222

New-CsBatchTeamsDeployment
– creating teams at scale and adding users- This is batch job, it get submitted.
- We can check the status of our teams creation with CMDLET – Get-CsBatchTeamsDeploymentStatus
PS C:\> Get-CsBatchTeamsDeploymentStatus -OrchestrationId 1.wjp.3271ab97-c3bb-491d-b3f3-0aff1014187c.d0a0524c-e6f6-4252-b261-8e240c1a0222
Output will be -
Completed

Get-CsBatchTeamsDeployment
Status – knowing the teams creation statusFollowing image shows the list of Teams created now
Following image show team “SPREAD HAPPINESS TEAM” created with owner – ThirdUser and shown in above Teams CSV file

Complete PowerShell script
PS C:\> Connect-MicrosoftTeams
Account Environment Tenant TenantId ------- ----------- ------ -------- prasham@knowledgejunction1.onmicrosoft.com AzureCloud 6b38e1c3-a1fe-40cc-8b93-a4159a50592c 6b38e1c3-a1fe-40cc-8b93-...
PS C:\> New-CsBatchTeamsDeployment -TeamsFilePath
'C:\Prasham\Articles\Teams\deployteamsatscale\teams.csv'
-UsersFilePath
'C:\Prasham\Articles\Teams\deployteamsatscale\USERS.csv'
-UsersToNotify "prasham@knowledgejunction1.onmicrosoft.com"
The deployment job has been submitted. OrchestrationID: 1.wjp.3271ab97-c3bb-491d-b3f3-0aff1014187c.d0a0524c-e6f6-4252-b261-8e240c1a0222
PS C:\> Get-CsBatchTeamsDeploymentStatus -OrchestrationId 1.wjp.3271ab97-c3bb-491d-b3f3-0aff1014187c.d0a0524c-e6f6-4252-b261-8e240c1a0222
Completed
PS C:\>
REFERENCES
- New-CsBatchTeamsDeployment
- Get-CsBatchTeamsDeploymentStatus
- https://knowledge-junction.in/2022/12/12/small-tips-and-tricks-how-to-know-the-version-of-any-installed-powershell-module-get-installedmodule/
Thanks for reading the article !! Please feel free to discuss in case any issues / suggestions / thoughts / questions !
HAVE A GREAT TIME AHEAD !!! LIFE IS BEAUTIFUL 🙂
You must log in to post a comment.