Tag Archives: Graph API

Manage the life cycle of private channels in Microsoft Teams

Microsoft has published a very useful article in “Manage the life cycle of private channels in Microsoft Teams”, which can be found here: https://docs.microsoft.com/en-us/microsoftteams/private-channels-life-cycle-management

In this post I have added my thoughts below some of their key points.

Set whether team members can create private channels

Team owners can turn off or turn on the ability for members to create private channels in team settings. To do this, on the Settings tab for the team, turn off or turn on Allow members to create private channels.

Microsoft
Microsoft Teams: Team Settings

As an admin, you can use Graph API, however currently there is not an option available for PowerShell (e.g. using the Set-Team PowerShell cmdlet – version 1.0.3).

Set whether users in your organization can create private channels

As an admin, you can set policies by using the Microsoft Teams admin center or PowerShell to control which users in your organization are allowed to create private channels.

Using the Microsoft Teams admin center

Use teams policies to set which users in your organization are allowed to create private channels. To learn more: https://docs.microsoft.com/en-us/microsoftteams/teams-policies

Microsoft

Using PowerShell

Use CsTeamsChannelsPolicy to set which users in your organization are allowed to create private channels. Set the AllowPrivateChannelCreation parameter to true to allow users who are assigned the policy to create private channels. Setting the parameter to false turns off the ability to create private channels for users who are assigned the policy.

Microsoft

NOTE: This cmdlet is currently (20/11/2019) only available in limited preview in the pre-release Teams PowerShell module.

Create a private channel on behalf of a team owner

As an admin, you can use PowerShell or Graph API to create a private channel on behalf of a team owner. For example, you may want to do this if your organization wants to centralize creation of private channels.

Microsoft

Pretty straight forward, for more information see the links below:

Find SharePoint URLs for all private channels in a team

Whether you’re looking to perform eDiscovery or legal hold on files in a private channel or looking to build a line-of-business app that places files in specific private channels, you’ll want a way to query the unique SharePoint site collections that are created for each private channel.

As an admin, you can use PowerShell or Graph APIs commands to query these URLs.

Microsoft
$sites = get-sposite -template "teamchannel#0" 
$groupID = “<group_id>" 
foreach ($site in $sites) {
  $x= Get-SpoSite -Identity $site.url -Detail; 
  if ($x.RelatedGroupId -eq $groupID) {
    $x.RelatedGroupId;$x.url
  }
} 
GET https://graph.microsoft.com/beta/teams/<group_id>/channels?$filter=membershipType   eq 'private'    

Compliance, eDiscovery and legal hold are all very important considerations when working with SharePoint and Microsoft Teams and I don’t see Private Channels being different. With that in mind, being able to quickly locate and manage the Site Collections (and data) is essential.

Currently there is not way to list and manage site collections created by Private Channel within the SharePoint Admin Center. Plus the PowerShell implementation is lagging behind the Graph API. That said with a little effort we can work around these limitations.

List and update roles of owners and members in a private channel

You may want to list out the owners and members of a private channel to decide whether you need to promote certain members of the private channel to an owner. This can happen when you have owners of private channels who have left the organization and the private channel requires admin help to claim ownership of the channel.

As an admin, you can use PowerShell or Graph APIs commands to query these URLs.

Microsoft

Pretty straight forward, for more information see the links below: