Microsoft Teams Private Channel Management with PowerShell

Microsoft Teams Private Channel Management with PowerShell

Microsoft Teams is a collaborative workspace widely used among Microsoft 365 users, facilitating seamless communication and teamwork. Within MS Teams, private channels offer a focused space for confidential discussions among specific Team members. Therefore, private channel management is essential to maintain security and productivity, aligning with Teams’ security best practices.

In this blog, we will delve into the significance of private channel management, explore the operations involved, and demonstrate how PowerShell can streamline the process.

Importance of Private Channel Management

Managing private channels in Microsoft Teams is essential for every M365 organization for the following reasons:

Controlling Private Channel Creation: By default, any member of a Team can create private channels, but the management of private channels allows admins to control who can create them.

Protecting Sensitive Information: Private channel management safeguards sensitive data by ensuring that only authorized group of members can have access to it. Therefore, efficient Teams membership management is crucial for private channels.

Manage Microsoft Teams Private Channel Using PowerShell

Microsoft Teams admins can effectively manage private channels within their organizations using these major PowerShell operations.

Now, you might wonder, “What is the need for PowerShell instead of the Teams admin center?” This question often arises for newcomers to PowerShell. Admins of large organizations prefer PowerShell due to its advanced features such as bulk operations, speed, automation, etc.

Before jumping into the cmdlets, make sure to connect to the MS Teams PowerShell module as an administrator.

Create Private Channels in Teams Using PowerShell

To create a private channel in Microsoft Teams, you can use the New-TeamChannel” cmdlet as described below.

New-TeamChannel -GroupId <GroupId> -DisplayName <PrivateChannelName> -MembershipType Private 

You can easily retrieve the Group Id of the respective Team using the “Get-Team cmdlet.

Private Channel Creation Using PowerShell

To track the recently created private channels, you make use of this dedicated PowerShell script to audit MS Teams channel creations.

Restrict Private Channel Creation with PowerShell

As mentioned earlier, any member of a Team can create private channels. But as admins, you can restrict the Teams users from creating private channels within the particular Team using the “Set-Team” cmdlet.

Set-Team -GroupId <GroupId> -AllowCreatePrivateChannels $false

Furthermore, you can leverage the power of PowerShell scripting to manage private channels and customize the channel creation policy.

List All Private Channels of a Team Using PowerShell

To list all the private channels that are present in a specific Team, use the cmdlet “Get-TeamAllChannel as mentioned below.

Get-TeamAllChannel -GroupId <GroupId> -MembershipType Private

Note: Keep in mind that this cmdlet only returns private channels linked to the designated team. Use the PowerShell script to export all private channels in Microsoft Teams. This script offers a more thorough overview of private channels throughout the Teams environment.

List all private channels present in a Team using PowerShell

Delete a Private Channel in Microsoft Teams

You can delete unwanted private channels in Microsoft Teams using the PowerShell cmdlet “Remove-TeamChannel” as mentioned below.

Remove-TeamChannel –GroupId <GroupId> -DisplayName <PrivateChannelName>

A deleted private channel can be restored within 30 days via the Teams client application after it’s deleted.

Note: In some cases, admins can also prefer archiving private channels in Microsoft Teams instead of deleting them. This allows them to declutter the active workspace while preserving valuable information for future reference.

Add Users to Private Channels in Microsoft Teams

The cmdlet “Add-TeamChannelUser” can add users as members to the Teams private channel. Use the cmdlet as mentioned below to add users to private channels in MS Teams.

Add-TeamChannelUser -GroupId <GroupId> -DisplayName <PrivateChannelName> -User <UserUPN> 

To promote members as owners of the private channel, include the “Role” parameter with the value “Owner” in the provided cmdlet.

Add-TeamChannelUser –GroupId <GroupId> -DisplayName <PrivateChannelName> -User <UserUPN> -Role Owner

Note: The creator of a private channel becomes the channel owner, and only the owner possesses the authority to add or remove members.

You can bulk-add users to private channels by creating a CSV file that includes the list of users’ UPNs. Once you have created the CSV file, execute the following cmdlet by giving the file location.

Add Bulk Users to Microsoft Teams Using PowerShell CSV File Format

Import-Csv <FileLocation>| ForEach {Add-TeamChannelUserGroupId <GroupId> -DisplayName <PrivateChannelName> -User $_.UPN}

Points to Remember:

  • The changes made through the cmdlet may not be instantly visible in the Teams client application. To observe the updates, simply refresh the member’s page of the channel.
  • Only members who are already part of the Team can be added to private channels.

List All Private Channel Members Using PowerShell

To list all the owners and the members of the Teams private channels, you can use the “Get-TeamChannelUser” cmdlet.

Get-TeamChannelUser –GroupId <GroupId> -DisplayName <PrivateChannelName>

Remove Users from Private Channels Using PowerShell

The cmdlet “Remove-TeamChannelUser“ removes a member from the private channel or demotes the existing owner into a member.

Remove-TeamChannelUser –GroupId <GroupId> -User <OwnerUPN> -DisplayName <PrivateChannelName> -Role Owner 

This cmdlet demotes the specified owner to a member in the respective private channel of the Team. Replace <OwnerUPN> with the UPN of the owner to be demoted.

Remove-TeamChannelUser –GroupId <GroupId> -User <MemberUPN> -DisplayName <PrivateChannelName>

This cmdlet removes the specified member from the respective private channel of the Team. Replace <MemberUPN> with the UPN of the member to be removed.

AdminDroid: A Game-Changer for MS Teams Private Channel Management

Although PowerShell proves to be a potent tool for managing Microsoft Teams private channels, administrators may occasionally encounter challenges that can add complexity to their management process.

To resolve this concern like a charm, AdminDroid is here to enhance your Teams management experience and make private channel reporting effortless! By using AdminDroid’s Microsoft Teams private channel reports, you can easily access detailed insights on the following.

  • Existing and recently created private channels
  • Private channel owners and members
  • External members/guests in private channels
  • Private channels without owner/Team owner
  • Empty private channels
  • MS Teams private channels with site info
  • Private channels over warning quota

Teams Private Channel Reporting - AdminDroid

AdminDroid goes beyond private channels, providing a suite of Microsoft Teams reports. From member details to Teams settings, user activities, daily summaries, and more. AdminDroid offers insights that enhance collaboration, productivity, and security.

Besides offering reporting features, the Microsoft Teams auditing tool from AdminDroid enables admins to easily track membership audits, Teams setting changes, Teams file transfers, user login activities, and more.

Microsoft Teams Channel Activities - AdminDroid

AdminDroid’s Microsoft Teams dashboards provide a panoramic view of Teams statistics, channel statistics, user activities, and membership patterns at a glance. It includes more than 110 inclusive reports, making it a comprehensive MS Teams management tool that covers all the features mentioned above.

AdminDroid isn’t only limited to Teams; it covers all Microsoft 365 services such as Azure AD, Exchange, SharePoint, Power BI, Yammer, and more with 1800+ reports and 30+ dashboards.

Download the AdminDroid Microsoft 365 reporting tool today and experience a 15-day premium trial version completely free!

Contributing to effective Teams management, we hope that this blog has highlighted the significance of private channel management and its operations using PowerShell. Elevate the overall productivity of your private channels with this strategy, and feel free to share any questions you might have.

Microsoft Teams Private Channel Management with PowerShell

by Thiraviam time to read: 5 min
0