Skip to content

How to add Azure AD group or M365 group to SharePoint group? #783

Answered by jansenbe
sachinsatav asked this question in Q&A
Discussion options

You must be logged in to vote

@sachinsatav : adding Azure AD security groups or members of the Microsoft 365 groups is possible, currently you'll need to correctly format the loginName. Below samples should help, the GUIDs are the object ids of the respective Azure AD objects.

// Add an Azure AD security group
await addedGroup.AddUserAsync("c:0t.c|tenant|c8e69a24-a625-48d7-b80b-c9656b9d4030");

// Add an Microsoft 365 group (members)
await addedGroup.AddUserAsync("c:0o.c|federateddirectoryclaimprovider|45dfc99d-a4a5-419d-ad79-013eed517fb2");

I'll add this information to our documentation, thanks for raising this.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jansenbe
Comment options

@sachinsatav
Comment options

Answer selected by sachinsatav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants