Series Introduction
For the past year or two, the company I work for has turned Teams into a core source of how we collaborate. We create Teams for internal stuff (org groups, internal projects, initiatives, etc). We also create teams for our project work as we are a consulting firm. This is all well and good, but as a ‘worker bee’ I don’t get to see the underbelly of the beast too much, so I’ve decided to do this via PowerShell in my own tenant. Luckily for me I am currently working on a side project that requires Teams, public and private channels, different memberships even within a team as well as dealing with guest vs full tenant level users. Taking all of these factors, I’ve decided to see what I can do with PowerShell to manage and work with this setup … and blogging about it! So this will be an entire series on Teams PowerShell – including interlocking aspects like Skype, Azure AD and Exchange PowerShell.
Blog Post 001
I currently have a few blog posts that cover various aspects about Microsoft Teams if you would like to review these before we dive in:
http://www.powershellgeek.com/2018/08/20/quick-reference-sheet-for-microsoft-teams-powershell/
http://www.powershellgeek.com/2017/12/08/quick-powershell-stuff-21-teams-powershell-module/
http://www.powershellgeek.com/2017/11/20/quick-powershell-20-teams-and-skype/
Now that we have that out of the way. Let’s dive in.
Microsoft Teams PowerShell Module
Like any other workload in Office 365 that has PowerShell exposed, Teams has a PowerShell module that we can explore. What is unique to Teams is that, while we can configure the ‘Teams’ part of Teams with this module, there are a lot of aspects that Teams utilizes that are not covered by this module. For now, we will keep as close as we can to the Teams module before heading out into the wilds of Skype PowerShell and it’s interconnects with Teams.
** Note **
Don’t forget to check to make sure your current Module is up to date before loading it!
Get-InstalledModule MicrosoftTeams | Update-Module Import-Module MicrosoftTeams
Once we have confirmed we have the latest Microsoft Teams module, we can connect to our tenant with the following:
Connect-MicrosoftTeams
And now we’re off. If we have any existing teams, we can see them with Get-Team: (sample results shown below):
So we see our Team has a GroupID (Important!), DisplayName, Visibility, Archived and MailNickName properties. Can we reveal more properties? Well, let’s look at our ProjectCodeX Team to see what we have. :
Get-Team -GroupID d36f235f-d30e-4460-98a2-5728b906fbfd | Fl
We see there are quite a few customizations that we can tweak with PowerShell, which we will get to next. Once item in particular may need to be tweaked is the mail nickname. This unique (unique in your tenant) identifier is associated with the Office 365 Group that is ties to each Team. Notice that, depending on how the Team was created, the Mail Nickname may be acceptable or ‘generic’:
Can we change this with PowerShell?
Set-Team -GroupId cfdba387-1319-4f6b-a883-8700046f07e7 -MailNickname SalesDepartmentTeam
Then we can verify the change like so:
Get-Team |ft GroupId,DisplayName,MailNickName -Auto
Which reveals the successful change:
What are the other properties can we change and what do they exactly do?
AllowGiphy
Set-Team -GroupId d36f235f-d30e-4460-98a2-5728b906fbfd -AllowGiphy $False
GiphyContentRating
The default on this team is ‘Strict’. We can adjust this to the other available option, Moderate:
Set-Team -GroupId d36f235f-d30e-4460-98a2-5728b906fbfd -GiphyContentRating 'Moderate'
What is interesting is that it looks like we can set this rating to something other than Strict or Moderate: (below is an Org Wide setting):
However PowerShell only has two different option – Strict or Moderate:
AllowStickersAndMemes
Set-Team -GroupId d36f235f-d30e-4460-98a2-5728b906fbfd -AllowStickersAndMemes $True
In our Team now, if we start a new reply, we see we have an additional icon:
If we click on the sticker icon we see that we have quite a few options to choose from:
Once an end user picks a sticker, the message on the sticker can be customized with NO restrictions. Something to keep in mind as by default there is no filter on what can be typed into the message:
(CENSORED for production!)
AllowCustomMemes
A custom meme is simply one in which the end user uploads an image and adds their words to it.
Set-Team -GroupId d36f235f-d30e-4460-98a2-5728b906fbfd -AllowCustomMemes $True
One thing Inoticed whike testing is that if an image has any sort of transparency (parts of the image with no colors), then the wording will not look right.
The words Top Caption and Bottom Caption are actually underneath the image, causing the issue. If we use an image with a solid background, we see there are no issues:
AllowGuestCreateUpdateChannels – Setting that determines whether or not guests can create channels in the team.
Set-Team -GroupId 5c8be873-a38a-4fbd-801a-f4c442244233 -AllowGuestCreateUpdateChannels $True
The default setting for a Team is that Guests cannot add or remove channels. When this setting is put in place, your guest users will now be able to add channels as they need. An ‘Add Channel’ will be revealed in their client:
AllowGuestDeleteChannels – Setting that determines whether or not guests can delete in the team.
Set-Team -GroupId 5c8be873-a38a-4fbd-801a-f4c442244233 -AllowGuestDeleteChannels $True
When this property for a team is set to true, then the option to delete a channel appears for a guest user:
AllowCreateUpdateChannels – Setting that determines whether or not members (and not just owners) are allowed to create channels.
Set-Team -GroupId 5c8be873-a38a-4fbd-801a-f4c442244233 -AllowCreateUpdateChannels $False
Once this is put in place, a regular member’s ‘Add channel’ option is removed as show below:
AllowDeleteChannels – Setting that determines whether or not members (and not only owners) can delete channels in the team.
Set-Team -GroupId 5c8be873-a38a-4fbd-801a-f4c442244233 -AllowDeleteChannels $False Set-Team -GroupId 5c8be873-a38a-4fbd-801a-f4c442244233 -AllowDeleteChannels $True
Once this is put in place, a regular member’s ‘Delete this channel’ option is removed as show below:
Set-Team -GroupId d36f235f-d30e-4460-98a2-5728b906fbfd -AllowAddRemoveApps $True Set-Team -GroupId d36f235f-d30e-4460-98a2-5728b906fbfd -AllowAddRemoveApps $False
From the below screenshots, we can see that this setting greatly reduces what can be added as a Tab in your Team:
Left – Setting is $False | Right – Settings is $True |
AllowCreateUpdateRemoveTabs – Setting that determines whether or not members (and not only owners) can manage tabs in channels.
Set-Team -GroupId d36f235f-d30e-4460-98a2-5728b906fbfd -AllowCreateUpdateRemoveTabs $False
Then this setting is set to false, the Rename/Remove options for a tab AND the ‘+’ button to add new apps are removed from Teams:
AllowCreateUpdateRemoveConnectors – Setting that determines whether or not members (and not only owners) can manage connectors in the team.
Set-Team -GroupId 5c8be873-a38a-4fbd-801a-f4c442244233 -AllowCreateUpdateRemoveConnectors $False
Notice how many options are removed with this one parameter:
AllowUserEditMessages – Setting that determines whether or not users can edit messages that they have posted.
Set-Team -GroupId 5c8be873-a38a-4fbd-801a-f4c442244233 -AllowUserEditMessages $False
Notice that a Team member’s ability to edit a message they wrote goes from being able to Edit messages, to having the edit button itself removed:
AllowUserDeleteMessages – Setting that determines whether or not members can delete messages that they have posted.
Set-Team -GroupId 5c8be873-a38a-4fbd-801a-f4c442244233 -AllowUserDeleteMessages $False
Notice that a Team member’s ability to edit a message they wrote goes from being able to Delete messages, to having the delete button itself removed:
AllowOwnerDeleteMessages – Setting that determines whether or not owners can delete messages that they or other members of the team have posted.
Set-Team -GroupId 5c8be873-a38a-4fbd-801a-f4c442244233 -AllowOwnerDeleteMessage $False
Similar to the action above, a Team’s owner would not be able to remove messages when this property is set to False.
AllowTeamMentions – Setting that determines whether the entire team can be @ mentioned (which means that all users will be notified)
Set-Team -GroupId 5c8be873-a38a-4fbd-801a-f4c442244233 -AllowTeamMentions $False
This is the default option, which allows the mentions of other Teams:
When we remove this option, we see that typing in the name of the group provides not matching objects.
AllowChannelMentions – Boolean value that determines whether or not channels in the team can be @ mentioned so that all users who follow the channel are notified.
Set-Team -GroupId 5c8be873-a38a-4fbd-801a-f4c442244233 -AllowChannelMentions $False
On the left, AllowChannelMentions is set to $True and on the right the value is $False. As we can see, the ability to add mentions of any channel are removed completely.
ShowInTeamsSearchAndSuggestions – Setting that determines whether or not private teams should be searchable from Teams clients for users who do not belong to that team. Set to $false to make those teams not discoverable from Teams clients.
For a private Team, a user who has access will be able to search for the team (Left) and someone who is not a member of the team will not be able to search for it. This is the default setting for Private Teams.
After the setting is changed to True:
Set-Team -GroupId 1c35706a-15ba-4ab1-b700-73af7c43a4ed -AllowChannelMentions $False
… a user who is not in the Team is able to search for it and display it in a list:
Conclusion
As we can see by the numerous options for a Microsoft Team, it appears that there are a lot of items that we can configure with PowerShell. Looks for another Teams PowerShell post next week. Thanks for reading.