Get-Team

This cmdlet supports retrieving teams with particular properties/information, inclding all teams that a specific user belongs to, all teams that have been archived, all teams with a specific display name, or all teams in the organization.

Syntax

Get-Team
   -GroupId <String>
   [-User <String>]
   [-Archived <Boolean>]
   [-Visibility <String>]
   [-DisplayName <String>]
   [-Alias <String>]
   [<CommonParameters>]
Get-Team
   [-User <String>]
   [-Archived <Boolean>]
   [-Visibility <String>]
   [-DisplayName <String>]
   [-Alias <String>]
   [<CommonParameters>]

Description

This cmdlet supports retrieving teams with particular properties/information, inclding all teams that a specific user belongs to, all teams that have been archived, all teams with a specific display name, or all teams in the organization.

Note: depending on the number of teams and O365 Groups in your organization and which filters you are using, this cmdlet can take upwards of ten minutes to run. Some of the input parameters are guaranteed unique (e.g. GroupId), and others serve as filters (e.g. -Archived).

Examples

Example 1

PS> Get-Team -User dmx1@example.com

Returns all teams that a user (dmx1@example.com) belongs to

Example 2

PS> Get-Team -Archived $true -Visibility Private

Returns all teams that are private and have been archived.

Parameters

-Alias

Specify the alias (also known as mailnickname) of the team that is being returned. This is a unique identifier and returns exact match.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Archived

If $true, filters to return teams that have been archived. If $false, filters to return teams that have not been archived. Do not specify any value to return teams that match filter regardless of archived state. This is a filter rather than an exact match.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisplayName

Filters to return teams with a full match to the provided displayname. As displayname is not unique, this acts as a filter rather than an exact match.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-GroupId

Specify the specific GroupId (as a string) of the team to be returned. This is a unique identifier and returns exact match.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-User

User's UPN (user principal name - e.g. johndoe@example.com)

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Visibility

Filters to return teams with a set "visibility" value. Accepted values are "Public" or "Private". Do not specify any value to return teams that match filter regardless of visibility. This is a filter rather than an exact match.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

UPN, UserID

Outputs

Team