How to access all company staff onedrive, and remove the folder inside it everyday?

Lap Sang, Oscar Yiu 6 Reputation points
2021-08-23T04:10:48.777+00:00

I am reading graph-explorer below. https://developer.microsoft.com/en-us/graph/graph-explorer

However, I don't know which api can access all staff one drive.

Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Danstan Onyango 3,906 Reputation points Microsoft Employee
    2021-08-26T11:54:02.91+00:00

    You can start with MS Graph Files API which allows you to list the files and delete them. The files APIs give you access to the one drive as per the permissions granted by the signed in user.

    Note that on Graph Explorer you can only do this for the current signed in user. To do this for all users in our tenant which is what I understand you mean by all staff, you need to use application permissions. Checkout Quickstart: Get a token and call the Microsoft Graph API by using a console app's identity.

    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.