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 with the specified MailNickName. (This acts as a filter rather than an exact match.)
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).
Returns the team that includes the specified escaped representation of its DisplayName, useful when the DisplayName has special characters. (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.
Parameter properties
Type:
Boolean
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
Identity
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
Filters
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DisplayName
Specify this parameter to return teams with the provided display name as a filter. As the display name is not unique, multiple values can be returned. Note that this filter value is case-sensitive.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
Identity
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
Filters
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-GroupId
Specify the specific GroupId (as a string) of the team to be returned. This is a unique identifier and returns exact match.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
Identity
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-MailNickName
Specify the mailnickname of the team that is being returned. This acts as a filter instead of being an exact match.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
Identity
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
Filters
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
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.
Parameter properties
Type:
Int32
Default value:
20
Supports wildcards:
False
DontShow:
False
Parameter sets
All
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
-User
User's UPN (user principal name - e.g.
johndoe@example.com)
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
Identity
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
Filters
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
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.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
Identity
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
Filters
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.