Team Channels
Channels are a way to category or separate out communications within a Team. These channels could be set up to parse out multiple internal or client based projects. Or they can be used to organize a large team into smaller groups to align with working groups or some other form of organization. Each Channel can be configured as either Standard or Private, like individual Teams can as well. Memberships can be different and apps presented can be different as well. Example of some teams:
When we click on a channel, we see that there are custom (and customizable) tabs at the top:
Channels allow us to create separate communication areas where we can customize the content, apps, and even members that have access to the information. Lastly we can also restrict the visibility of the group by changing the group to a Private group. In this article we will look at what we can do with Channels with PowerShell, which, as we get deeper, isn’t really that much.
PowerShell
We can locate all Channel commands that exist for Teams like so:
Get-Command *channel* | Where {$_.Source -eq 'MicrosoftTeams'}
In a new / greenfield environment, there won’t be any channels, not for that matter would there be any Teams. Creating a Team Channel assumes that you have a Team already created. For the purposes of this blog post, we’ll assume that we have some Teams already created so we can work on creating, manipulating and even removing Team Channels.
Finding all of the Teams Channels
With a little bit of code manipulation, we can use PowerShell to find all Channels that exist for each Team in a tenant. The code would look something like this:
CLS Foreach ($Team in $Teams){ $GroupID = $Team.GroupID $DisplayName = $Team.DisplayNameWrite-Host "$DisplayName Team Channels:" -ForegroundColor Green Get-TeamChannel -GroupID $GroupID |Ft DisplayName,Description }
Create a New Channel
Creating a new Teams Channel only has a couple of requirements – GroupID of the Team the channel will reside in, a description and a display name. Let’s take for example the Sales Department. They want to start a new channel for discussions on sales for a particular problem region. We first need the GroupID:
Get-Team | Where {$_.DisplayName -eq 'Sales Department'}
Copying the GroupID, we can then create our channel called ‘Problem Sales’ in the Team:
New-TeamChannel -GroupId cfdba387-1319-4f6b-a883-8700046f07e7 -DisplayName 'Problem Sales' -Description 'Channel to discuss any regional sales problems.'
Which displays the creation:
We can verify the channel with PowerShell:
Get-TeamChannel -GroupId cfdba387-1319-4f6b-a883-8700046f07e7
And in the Microsoft Teams client:
Set-TeamChannel
If changes were needed on a Teams Channel after making it, just like in creation, there are not a lot of options we can use to change then. Looking over the help for the cmdlet, we can change the Display Name and the Description. That’s it. Let take for example a channel that was created for the Marketing Team called ‘Demo Campaign’ which looks like this:
The Marketing Department would like to rename it as ‘Internal Marketing Development’ with a new description to boot. We can use the Set-TeamChannel cmdlet to do that:
Set-TeamChannel -GroupId a4d3425f-98b2-420d-a0a0-7c3eff32493f -CurrentDisplayName 'Demo Campaign' -NewDisplayName 'Internal Marketing Development' -Description 'Channel used to discuss new Marketing Campaign development.'
Missing Features
PowerShell is supposed to be the backend, but when diving into Microsoft Teams, there are items that show in the GUI and not in PowerShell. For example, with Channels we are not able to create a Private Team and are instead (for now) stuck with Standard Channels. In the client we see this:
PowerShell does not provide an option for this for channels. Go up a level and create a Team and we can set the ‘visibility’ to Private or Public for this function. We also cannot add users to a Channel, though we can add manager users in Microsoft Teams with the Add-TeamUser, Get-TeamUser and Remove-TeamUser cmdlets. It would be nice to be able to add users to Channels with PowerShell as well.
We also cannot assign an app to a Channel either as there is no PowerShell for that. This would be a good feature to add at a later date.
Next week we will cover users and Teams, including tie ins with Azure AD for Guests and Office 365 Groups.