Create Multiple Microsoft Teams Channels with PowerShell
Microsoft Teams is a collaboration tool that allows users to communicate and share ideas. It offers several in-app features that allow users to easily create, update and manage their channels. A channel is a workspace for Teams users to collaborate on projects and communicate with team members. Users can create channels for their team, share files, access apps and collaborate on tasks.
Microsoft Teams offers several options when creating a channel. Users can choose a channel style, upload images, collaborate on tasks and interact with other users’ channels. Microsoft Teams also has the ability to bulk create multiple channels within a workspace. The easiest way to create bulk private/standard channels with PowerShell.
Remember the channel limits in Microsoft Team before creating them. You can read more about Microsoft Team specifications and limits here
Number of channels per team | 200 (includes deleted channels) |
Number of Private channels per team | 30 (includes deleted channels) |
In first step, You will connect to Microsoft Team with PowerShell and find Team ID. Team name is “TestTeam01”
Connect-MicrosoftTeams
Import-Module -Name MicrosoftTeams
Get-Team -DisplayName “TestTeam01”
Team ID / GroupId in this example is “85365f30-4293-4708-9aa7-986420d759d1”
Now you need to create a CSV file which will have all the information. Here is example CSV file format
ObjectID,Name,Type,UPN
TeamID,Channelname,Private,User1@domain
TeamID,Channelname,Standard,User2@domain
TeamID,Channelname,Shared,User3@domain
ObjectID is name of Groupid where you will create these channels in bulk.
Name is channel name.
Type is type of channel, private/standard/shared
UPN is channel owner Userprincipalname
You can download sample csv file here.
Next step is to run the actual script to create bulk channel in Microsoft Team “TestTeam01”
Function CheckTeamsModule (){
if(Get-InstalledModule -Name Microsoftteams*) {
Write-Host “MicrosoftTeams is already installed”
}
else{ Install-Module -Name MicrosoftTeams -Force}
}
CheckTeamsModule
import-module microsoftteams
Connect-MicrosoftTeams
Function createChannels() {
$channels = import-csv c:\Temp\ChannelsList.csv
Foreach($channel in $channels)
{
New-TeamChannel -GroupId $channel.ObjectID -DisplayName $channel.Name -MembershipType $channel.Type -Owner $channel.Upn
}
}
createChannels
Once you have created multiple channels, you can also use PowerShell to import bulk users in Microsoft Teams channels.