How to manage channels in Microsoft Teams using PowerShell
The New-TeamChannel cmdlet helps add a new channel to a team using PowerShell. The script below will help you add a new channel with inputs such as Group Id, DisplayName and more.
New-TeamChannel -GroupId <String>] -DisplayName <String>] [-Description <String>] [-MembershipType<String>] [-Owner<String>][<CommonParameters>]
The Set-TeamChannel cmdlet helps update existing channels using PowerShell. The script below will help you update a channel with inputs such as Group Id, CurrentDisplayName and more.
Set-TeamChannel -GroupId <String>] -CurrentDisplayName <String>] [-NewDisplayName <String>] [-Description<String>] [<CommonParameters>]
The Remove-TeamChannel cmdlet will soft delete a channel. The channel can be restored within 21 days, before being permanently deleted. During these 21 days, any request to add a new channel with the same name as the soft deleted one, will fail.
Remove-TeamChannel -GroupId <String>] -DisplayName <String>] [<CommonParameters>]
The Add-TeamChannelUser cmdlet in PowerShell helps you add a member or owner to a channel in Microsoft Teams. You must refresh the members page to see the updates.
Add-TeamChannelUser -GroupId <String> -DisplayName <String> -User <String> [-Role <String>] [<CommonParameters>]
Eg. Add-TeamChannelUser -GroupId 761c15c-i67c-9o7a-b3t5-hyji7fd667p -DisplayName "Marketing" -User harry@zohocorp.com
This example shows how to add user Harry to a private channel named Marketing under the group with the mentioned group ID.
The Remove-TeamChannelUser cmdlet in PowerShell helps you remove a member or turn an owner to a member in a channel. You must refresh the members page in Microsoft Teams to see the updates.
Remove-TeamChannelUser -GroupId <String> -DisplayName <String> -User <String> [-Role <String>] [<CommonParameters>]
Eg. Remove-TeamChannelUser -GroupId 761c15c-i67c-9o7a-b3t5-hyji7fd667p -DisplayName "Team1" -User ronald@zohocorp.com
This example shows how to remove user Ronald from a private channel named Team1 under the group with the mentioned group ID.
Using PowerShell to manage Microsoft Teams requires you to have appropriate permissions. It can also be complex, time-consuming and error-prone. M365 Manager Plus, the extensive Microsoft 365 tool simplifies Teams management with its bulk management feature.
How can M365 Manager Plus help?
The user-friendly interface helps you easily create, update and delete channels in bulk by simply importing a CSV file. You can also create automated workflows in the tool to manage Teams. This will help save time and reduce your workload.
Managing channels in bulk using M365 Manager Plus:
- Navigate to the Management tab.
- Go to Microsoft Teams in the left pane.
- Select Team Tasks > Create Team Channel or any other required action.
- Select the required Team from the list.
- Select the required Microsoft 365 Tenant from the drop-down box.
- Import the required CSV file.
- Click Import Team(s).
To learn more about managing Microsoft Teams using M365 Manager Plus, click here.