0

I am adding users to a Site in SharePoint by getting the Microsoft-365-Group behind the Site and adding the users as members of that Microsoft-365-Group. I use the method described here. However, it can take a long time until the user that was added can access the SharePoint Site.

When I create a Microsoft-365-Group using the method described here the users can access the SharePoint Site that gets created for the group immediately.

I can't find any documentation that explains or even mentions this delay except from here. Does anyone know why this delay is so long when everything else within SharePoint and Graph API seems to be within a minute to propagate? Does someone know of an alternative method to add users to a Microsoft-365-Group using the Graph API that does not take so long time?

2 Answers 2

1

This is because Microsoft 365 groups are Azure Active Directory groups. Changes to AAD groups take time to synchronise with SharePoint Online. Sadly, it's not clear how long this takes because it depends upon server side processes. I don't believe it makes any difference how you add the user to the AAD group, the synchronisation delay still exists.

0

Callum's explanation makes sense but does not provide a solution to the problem and no source to verify that that is indeed the case. I have found a solution so I have decided to provide an answer to my own question and mark it as the accepted one.

This problem seems to be isolated to the PatchAsync method used to add multiple users to a group. The solution is to simply add one user at a time with the code in Example 1. Obviously this is not ideal since one would like to make as few calls as possible but at least the change happens almost instantly instead of waiting up to two hours for the change to occur on SharePoint.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.