Accessing all users one drive files using graph

拜拜、爱过 提交于 2019-12-13 04:01:24

问题


Possibly I am posting the duplicate question as already described in the post below.

How to get admin access to files for all user's OneDrive

We are running in to same issue. Can not access any users one drive with following api:

https://graph.microsoft.com/v1.0/users/{userPrincipalName}/drive/root/children

we have all the permissions in place and account used for authentication is Global Administrator.

Interestingly,as described in the article below, when we provide access from the Admin Portal on each users one drive, above api works well with the same set of permissions.

https://sharepointmaven.com/how-to-access-someone-elses-onedrive-account/

When we try the api below, States code is 200 but no data. https://graph.microsoft.com/v1.0/users/{useremail}/drives

Appreciate your help.


回答1:


I was able to solve this. As doubt, it was a permission issue. I had tried the sample as described in the blog below:

https://azure.microsoft.com/en-us/resources/samples/active-directory-dotnet-daemon-v2/

Configured the app permission in Azure AD (App Registration(Preview)) as shown below:

It started working. Also, I should mention that this never worked in Graph Explorer.

Hope this helps.



来源:https://stackoverflow.com/questions/54668856/accessing-all-users-one-drive-files-using-graph

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!