You are on page 1of 2

Get-Team and Filtering

The big changes in the V1.0 module are in the Get-Team cmdlet. First, Get-
Team supports basic filtering capabilities. Get-Team can return a set of
teams:

Owned by someone: specify the User parameter and pass the user’s email
address:

PowerShell
1 Get-Team -User Oisin.Johnston@Office365itpros.com

Archived (read-only): specify the Archived parameter and set it to $True to


return a set of archived teams or $False to see a set of teams that are not
archived.

PowerShell
1 Get-Team -Archived $True

Access (public or private): specify the Visibility parameter and set it to


Public or Private to retrieve the teams you want:

PowerShell
1 Get-Team -Visibility Public

You can combine the parameters too:

PowerShell
1 Get-Team -Visibility Private -Archived $True -User Tony.Redmond@office365itpros.com

While you retrieve sets of teams with Get-Team, two issues become
painfully apparent. First, the cmdlet is slow. Second, the filters are client-
side rather than server-side and don’t support the kind of filtering
functionality that you might be accustomed to with cmdlets like Get-Mailbox.
For instance, wildcard matching is unsupported.

This won’t be a big deal when you only work with a few teams, but it
becomes a much bigger problem as the number of teams mounts into the
hundreds or thousands.
Microsoft acknowledges that performance isn’t what it should be, and we
can hope for improvements in the future. Unfortunately, the Get-
UnifiedGroup cmdlet (often used to retrieve information not returned by Get-
Team) is a sloth of a cmdlet too. The net is that we have plenty of time to
drink coffee.

Simplification and Consolidation in Team Settings


The original version of Get-Team returned just a few properties for a team.
With this release, Microsoft has deprecated several subsidiary cmdlets
into Get-Team so that the one cmdlet can return all the settings related to a
team. For example, you don’t have to run Get-TeamGuestSettings to find
out what guest users can do in a team or Get-TeamFunSettings (an
excellent name) to return the settings controlling the use of GIFS and
stickers in chats. This change and the associated change to Set-Team to
set values for team settings might mean that you need to update scripts.

Here’s what the full set of properties returned for a team looks like:

PowerShell
1 Get-Team -GroupId de797c44-d998-4682-b1e0-aa938cfc05a8 |Format-List
2
3 GroupId : de797c44-d998-4682-b1e0-aa938cfc05a8
4 DisplayName : Forza Roma
5 Description : Rome at its best
6 Visibility : Public
7 MailNickName : ForzaRoma
8 Classification :
9 Archived : False
10 AllowGiphy : True
11 GiphyContentRating : moderate
12 AllowStickersAndMemes : True
13 AllowCustomMemes : True
14 AllowGuestCreateUpdateChannels : False
15 AllowGuestDeleteChannels : False
16 AllowCreateUpdateChannels : True
17 AllowDeleteChannels : True
18 AllowAddRemoveApps : True
19 AllowCreateUpdateRemoveTabs : True
20 AllowCreateUpdateRemoveConnectors : True
21 AllowUserEditMessages : True
22 AllowUserDeleteMessages : True
23 AllowOwnerDeleteMessages : True
24 AllowTeamMentions : True
25 AllowChannelMentions : True

As mentioned above, the Set-Team cmdlet now can control all the settings
previously set in cmdlets like Set-TeamGuestSettings. For example:

PowerShell
1 Set-Team -GroupId de797c44-d998-4682-b1e0-aa938cfc05a8 -AllowGuestCreateUpdateChannels $True

You might also like