Delete Multiple Microsoft Teams Channels PowerShell

In this blog post, I will show you how to delete multiple MS Teams Channels from a CSV file.

 Get GroupID

Before we can delete channels, we need to find the GroupId value of the Team we are going to delete the channels.

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

Get-Team

CSV

Below, is my CSV file with the channels name I need to delete.

To get a list of channels, visit the this blog post.

Delete Channels

Now, I will run the cmdlet below that will delete all the above channels.

Import-csv ch.csv | foreach {remove-TeamChannel -GroupId e10adbb0-07dc-41a2-9672-7ae3b7cc83da -DisplayName $_.cname}

View Channels

To view all the remaining channels, I will run the following cmdlet.

get-TeamChannel -GroupId e10adbb0-07dc-41a2-9672-7ae3b7cc83da | ft

Processing…
Success! You're on the list.

Posted

in

by