Get-Team

This cmdlet supports retrieving teams with particular properties/information, including 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>]
   [-MailNickName <String>]
   [-NumberOfThreads <Int32>]
   [<CommonParameters>]
Get-Team
   [-User <String>]
   [-Archived <Boolean>]
   [-Visibility <String>]
   [-DisplayName <String>]
   [-MailNickName <String>]
   [-NumberOfThreads <Int32>]
   [<CommonParameters>]

Description

This cmdlet supports retrieving teams with particular properties/information, including 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

Get-Team may return multiple results matching the input and not just the exact match for attributes like DisplayName/MailNickName. This is known behavior.

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.

Example 3

PS> Get-Team -MailNickName "BusinessDevelopment"

Returns the team that matches the specified MailNickName

Example 4

PS> Get-Team -DisplayName "Sales and Marketing"

Returns the team that includes the specified text in its DisplayName. (This acts as a filter rather than an exact match).

Parameters

-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. Note that this filter value is case-sensitive.

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
-MailNickName

Specify the mailnickname of the team that is being returned. This acts as a filter instead of being an exact match.

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

Specifies the number of threads to use. If you have sufficient network bandwidth and want to decrease the time required to retrieve the list of teams, use the -NumberOfThreads parameter, which supports a value from 1 through 20.

Type:Int32
Position:Named
Default value:20
Accept pipeline input:True
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", "Private" or "HiddenMembership". 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