Get-PnPSiteGroup

Tip

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

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Gets all the groups in the current or specified site collection.

Syntax

Get-PnPSiteGroup
     [-Group <String>]
     [-Site <SitePipeBind>]

Description

Use the Get-PnPSiteGroup cmdlet to get all the groups on the specified or currently connected site collection.

Examples

EXAMPLE 1

Get-PnPSiteGroup

Returns all SharePoint groups in the current connected to site

EXAMPLE 2

Get-PnPSiteGroup -Site "https://contoso.sharepoint.com/sites/siteA"

This will return all SharePoint groups in the specified site

EXAMPLE 3

Get-PnPSiteGroup -Group "SiteA Members"

This will return the specified group for the current connected to site

EXAMPLE 4

Get-PnPSiteGroup -Group "SiteA Members" -Site "https://contoso.sharepoint.com/sites/siteA"

This will return the specified group for the specified site.

Parameters

-Group

Specifies the group name.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Site

Retrieve the associated member group.

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