Table of Contents

Get-PnPTeamsUser

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Group.Read.All, Group.ReadWrite.All
  • Microsoft Graph API : Directory.Read.All

Returns owners, members or guests from a team.

SYNTAX

Get-PnPTeamsUser -Team <TeamsTeamPipeBind> [-Channel <TeamsChannelPipeBind>] [-Role <String>]
  

DESCRIPTION

Allows to retrieve list of owners, members or guests from a team.

EXAMPLES

EXAMPLE 1

Get-PnPTeamsUser -Team MyTeam

Returns all owners, members or guests from the specified team.

EXAMPLE 2

Get-PnPTeamsUser -Team MyTeam -Role Owner

Returns all owners from the specified team.

EXAMPLE 3

Get-PnPTeamsUser -Team MyTeam -Role Member

Returns all members from the specified team.

EXAMPLE 4

Get-PnPTeamsUser -Team MyTeam -Role Guest

Returns all guests from the specified team.

PARAMETERS

-Channel

Specify the channel id or display name of the channel to use.

Type: TeamsChannelPipeBind
Parameter Sets: (All)

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

-Role

Specify to filter on the role of the user

Type: String
Parameter Sets: (All)
Accepted values: Owner, Member, Guest

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

-Team

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Microsoft 365 Patterns and Practices