Get-PnPGroup

Returns a specific SharePoint group or all SharePoint groups in site.

Syntax

Get-PnPGroup
   [-Identity <GroupPipeBind>]
               [-Web <WebPipeBind>]
               [-Connection <SPOnlineConnection>]
Get-PnPGroup
   [-AssociatedMemberGroup [<SwitchParameter>]]
               [-Web <WebPipeBind>]
               [-Connection <SPOnlineConnection>]
Get-PnPGroup
   [-AssociatedVisitorGroup [<SwitchParameter>]]
               [-Web <WebPipeBind>]
               [-Connection <SPOnlineConnection>]
Get-PnPGroup
   [-AssociatedOwnerGroup [<SwitchParameter>]]
               [-Web <WebPipeBind>]
               [-Connection <SPOnlineConnection>]
Get-PnPGroup
   [-Includes <String[]>]
               [-Web <WebPipeBind>]
               [-Connection <SPOnlineConnection>]

Examples

------------------EXAMPLE 1------------------

Get-PnPGroup

Returns all SharePoint groups in a site

------------------EXAMPLE 2------------------

Get-PnPGroup -Identity 'My Site Users'

This will return the group called 'My Site Users' in 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
Accept pipeline input:False
Accept wildcard characters:False
-AssociatedOwnerGroup

Retrieve the associated owner group

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

Retrieve the associated visitor group

Type:SwitchParameter
Position:Named
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:SPOnlineConnection
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Identity

Get a specific group by name

Type:GroupPipeBind
Aliases:Name
Position:0
Accept pipeline input:True
Accept wildcard characters:False
-Includes

Specify properties to include when retrieving objects from the server.

Type:String[]
Position:0
Accept pipeline input:False
Accept wildcard characters:False
-Web

The web to apply the command to. Omit this parameter to use the current web.

Type:WebPipeBind
Position:Named
Accept pipeline input:False
Accept wildcard characters:False

Outputs

List<Microsoft.SharePoint.Client.Group>