Create Multiple Microsoft Teams Channels PowerShell

In this blog post, I will show you how to add multiple channels to Microsoft Teams team using PowerShell.

I will also use a CSV file and set some of the channels to be private and some to be standard.

Private or Standard Channel

Microsoft Teams offers two types of channels.

Private – Offer limited access to team members and block access to all other Team members.

Standard – Allow access to all members of the Team.

Prerequisite

To use create multiple channels and set the private or standard channel option we need to use Beta MS teams PowerShell module.

Please use the following blog post to install the beta version.

Connect

After installing the Beta PS module, connect to Teams using the following cmdlet.

connect-microsoftteams

Get GROUPID

Once connected, we need to find the GroupId value of the Team we would like to create all the channels.

To find the GroupId value, I will run the following cmdlet.

From the list, I will copy the GroupId value.

Get-Team

Fill in CSV

I also have a CSV file with a list of all the new channels and which type they are.

The CSV file structure is shown below.

Run Cmdlet

To add the channels I will run the following cmdlet.

Import-csv ch.csv | foreach{New-TeamChannel -GroupId GROUOPID -DisplayName $_.ch -MembershipType $_.type}

After I finished running the cmdlet, I will see the new channels and type as shown below.

Processing…
Success! You're on the list.

Posted

in

by