Get-PnPGroup

Tip

We encourage you to make improvements to this documentation. Please navigate to https://github.com/pnp/powershell/blob/dev/documentation/Get-PnPGroup.md to change this file.

Returns a specific SharePoint group or all SharePoint groups in the current site

Syntax

Get-PnPGroup
   [-Connection <PnPConnection>]
   [-Includes <String[]>]
   [<CommonParameters>]
Get-PnPGroup
   [[-Identity] <GroupPipeBind>]
   [-Connection <PnPConnection>]
   [-Includes <String[]>]
   [<CommonParameters>]
Get-PnPGroup
   [-AssociatedMemberGroup]
   [-Connection <PnPConnection>]
   [-Includes <String[]>]
   [<CommonParameters>]
Get-PnPGroup
   [-AssociatedVisitorGroup]
   [-Connection <PnPConnection>]
   [-Includes <String[]>]
   [<CommonParameters>]
Get-PnPGroup
   [-AssociatedOwnerGroup]
   [-Connection <PnPConnection>]
   [-Includes <String[]>]
   [<CommonParameters>]

Examples

EXAMPLE 1

Get-PnPGroup

Returns all SharePoint groups in the current site

EXAMPLE 2

Get-PnPGroup -Identity 'My Site Users'

This will return the group called 'My Site Users' if available in the current site

EXAMPLE 3

Get-PnPGroup -AssociatedMemberGroup

This will return the current members group for the site

Parameters

-AssociatedMemberGroup

Retrieve the associated member group

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AssociatedOwnerGroup

Retrieve the associated owner group

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AssociatedVisitorGroup

Retrieve the associated visitor group

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type:PnPConnection
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Identity

Get a specific group by its name or id

Type:GroupPipeBind
Aliases:Name
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False