Sign up ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm attempting to use the REST API to migrate files from our users' personal sharepoint sites (e.g.

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| 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."}}}
share|improve this question
Did you try to add FullControl permission on the Tenant? – Vardhaman Deshpande Dec 4 '13 at 6:28
I can't request the FullControl permission via OAuth - AFAIK. – Koobz Dec 10 '13 at 17:39 "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 '13 at 17:41

1 Answer 1

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

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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