I'm attempting to use the REST API to migrate files from our users' personal SharePoint sites (e.g. http://organization-my.sharepoint.com/personal/[email protected]).

The account which I've authorized is a global administrator in the system. During the OAuth flow, our app requests the AllSites.Manage and AllProfiles.Manage scopes.

I'm able to view/modify my personal site without difficulty. In order to view other users' personal sites, I have to add myself as a "site collection owner" in: SharePoint admin center -> user profiles -> i:0#.f|membership|[email protected] Doing so it rather tedious and I'd like to either automate the process, or find some way to configure my app scopes / administrative user so it's not necessary.

To that end, I've been trying to assign permissions via the roleassignments endpoints. Unfortunately, _api/web/roleassignments consistently returns:

{"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":   {"lang":"en-US","value":"Access denied. You do not have permission to perform this action or access this resource."}}}
  • Did you try to add FullControl permission on the Tenant? Dec 4, 2013 at 6:28
  • I can't request the FullControl permission via OAuth - AFAIK.
    – Koobz
    Dec 10, 2013 at 17:39
  • msdn.microsoft.com/en-us/library/jj687470.aspx "Table 1 shows the same app permission request scope URIs that are shown in App permissions in SharePoint 2013, except it has one additional column (Scope Alias) and the FullControl right is not available in the Available Rights column."
    – Koobz
    Dec 10, 2013 at 17:41

2 Answers 2


You could use the following powershell script to add your account to the site collection before hand, you could also provision the onedrive sites. I'm working on a similar project myself. Onedrive for Business - Assign a user as a site collection administrator to OneDrive for Business sites


please refer link for role assignment:


Your Answer

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

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