Skip to main content

Get Group

Updated this week

Name

Get-Group

Description

The command to get groups from a SharePoint site.

Note: This command does not apply to Microsoft 365 Groups.

Examples

Get All Groups

$site = Connect-Site -Url "http://myfarm1/sites/mysitecollection"
Get-Group -Site $site

Get Groups Matching Name

$site = Connect-Site -Url "http://myfarm1/sites/mysitecollection"
Get-Group -Site $site -Name MyName*,MySpecificName

Note: The * symbol is used to call multiple objects with a similar name.

Get Groups Matching Id

$site = Connect-Site -Url "http://myfarm1/sites/mysitecollection"
Get-Group -Site $site -Id 12

Syntax

Get-Group
[-Site] <Site>
[[-Name] <String[]>]
[[-Id] <String[]>]

Parameters

-Id <String[]>

Specifies the ID (Wildcards supported).

Required?

False

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

True

Parameter set name

(All)

Aliases

None

-Name <String[]>

Specifies the name (Wildcards supported).

Required?

False

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

True

Parameter set name

(All)

Aliases

None

-Site <Site>

Specifies the SharePoint site.

Required?

True

Default value

None

Accept pipeline input?

True (ByValue, ByPropertyName)

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

Did this answer your question?