SP Permissions | Issue adding a user to SharePoint Group

Dev User 1 Reputation point
2020-11-04T14:19:58.247+00:00

We send similar request multiple times to target and have different results each time.
In 2 out of 10 instances it's will set fine, and sometimes permissions will take 10 minutes to be set and more so often it will not be set at all.

\\

Following is the Request Body:

<?xml version="1.0" encoding="UTF-8"?><Request xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009" AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName="Java Library"><Actions><ObjectPath Id="2" ObjectPathId="1"/><ObjectPath Id="4" ObjectPathId="3"/><ObjectPath Id="6" ObjectPathId="5"/><ObjectPath Id="8" ObjectPathId="7"/><ObjectPath Id="10" ObjectPathId="9"/><ObjectPath Id="12" ObjectPathId="11"/><ObjectPath Id="14" ObjectPathId="13"/></Actions><ObjectPaths><StaticProperty Id="1" TypeId="{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}" Name="Current"/><Property Id="3" ParentId="1" Name="Web"/><Property Id="5" ParentId="3" Name="SiteGroups"/><Method Id="7" ParentId="5" Name="GetByName"><Parameters><Parameter Type="String">NataPerm Owners</Parameter></Parameters></Method><Method Id="9" ParentId="3" Name="EnsureUser"><Parameters><Parameter Type="String">i:0#.f|membership|user@adoamin.onmicrosoft.com</Parameter></Parameters></Method><Property Id="11" ParentId="7" Name="Users"/><Method Id="13" ParentId="11" Name="AddUser"><Parameters><Parameter ObjectPathId="9"/></Parameters></Method></ObjectPaths></Request>

In all cases we have the same response from SharePoint - no errors :

129

[

{

"SchemaVersion":"15.0.0.0","LibraryVersion":"16.0.20621.12004","ErrorInfo":null,"TraceCorrelationId":"4fb3899f-201e-0000-4eca-f2a28c6c6305"

},2,{

"IsNull":false

},4,{

"IsNull":false

},6,{

"IsNull":false

},8,{

"IsNull":false

},10,{

"IsNull":false

},12,{

"IsNull":false

},14,{

"IsNull":false

}

]

0

But permission were not added. We did a test in PowerShell – same problem: User was not added and no errors from SharePoint

Questions: I. Why is there no feedback in the response.

ii. How to find out if we are throttled?

iii. We suspect that the permission is a async operation in the background, so does it gets executed in a timeframe or it is queued and will certainly be executed or will be terminated randomly based on load on the server?

iv. Any better way to handle permission then we already are?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,621 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Elsie Lu_MSFT 9,796 Reputation points
    2020-11-05T07:49:54.917+00:00

    Hi @Dev User ,
    For you questions,

    i. Why is there no feedback in the response.
    Would you like to say a bit more about how you send the request? Are you using a Rest API in Flow or PowerShell script ? Please provide your script or request.

    ii. How to find out if we are throttled?
    Have a check on this doc. Mostly you will get 429 or 503 if you get throttled. https://learn.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online#what-happens-when-you-get-throttled-in-sharepoint-online

    iii. We suspect that the permission is a async operation in the background, so does it gets executed in a timeframe or it is queued and will certainly be executed or will be terminated randomly based on load on the server?
    It is hard to say without any information from you actual actions.

    iv. Any better way to handle permission then we already are?
    You can try to use PNP commands like Add-PnPUserToGroup: https://learn.microsoft.com/en-us/powershell/module/sharepoint-pnp/add-pnpusertogroup?view=sharepoint-ps
    Example : https://www.sharepointdiary.com/2018/06/sharepoint-online-bulk-import-users-from-csv-using-powershell.html

    And I assume you are using SharePoint Online, please let me know if that is not your scenario.

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.