< Back

Get-Team

Sat Jan 18, 2020 4:16 pm

NAME Get-Team



SYNOPSIS

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 [-User <String>] [-Archived <Boolean>] [-DisplayName <String>] -GroupId <String> [-MailNickName <String>]

[-Visibility <String>] [<CommonParameters>]



Get-Team [-User <String>] [-Archived <Boolean>] [-DisplayName <String>] [-MailNickName <String>] [-Visibility

<String>] [<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: 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).





PARAMETERS

-User <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Archived <Boolean>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DisplayName <String>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-GroupId <String>

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

returns exact match.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-MailNickName <String>

Specify the mailnickname of the team that is being returned. This is a unique identifier and returns exact

match.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Visibility <String>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

UPN, UserID







OUTPUTS

Team







NOTES









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



RELATED LINKS

New-Team

Set-Team