Skip to content

Get All groups from a SharePoint Site (including Domain Groups) #3105

Answered by AndersRask
skywalkerisnull asked this question in Q&A
Discussion options

You must be logged in to vote

The security groups are fetched using Get-PnPUser and are of PrincipalType: SecurityGroup

Also you need to load the properties on the web. Something along these lines

$web = get-pnpweb -Connection $c -Includes RoleAssignments,SiteGroups, RoleDefinitions,HasUniqueRoleAssignments
$web.RoleAssignments | % { Get-PnPProperty -Property Member -ClientObject $_ -Connection $c| select -expand loginname }

Hope this helps

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@skywalkerisnull
Comment options

Answer selected by skywalkerisnull
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants