SOLVED

Graph api to list one drive for business users

%3CLINGO-SUB%20id%3D%22lingo-sub-1450103%22%20slang%3D%22en-US%22%3EGraph%20api%20to%20list%20one%20drive%20for%20business%20users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1450103%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%2C%3C%2FP%3E%3CP%3EI%20am%20looking%20for%20an%20end%20point%20in%20microsoft%20graph%20api%20which%20could%20help%20me%20to%20list%20all%20the%20users%20in%20my%20azure%20ad%20who%20are%20having%20access%20to%20one%20drive%20for%20business.%20I%20have%20gone%20through%20many%20blogs%20and%20sites%20but%20i%20could%20not%20find%20any%20information%20on%20it.%20Can%20anyone%20here%20please%20help%20me%20with%20that!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20Advance%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1450158%22%20slang%3D%22en-US%22%3ERe%3A%20Graph%20api%20to%20list%20one%20drive%20for%20business%20users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1450158%22%20slang%3D%22en-US%22%3E%3CP%3EThere's%20no%20single%20endpoint%2Fquery%20that%20can%20give%20you%20that%20information.%20You%20can%20either%20get%20the%20list%20via%20SPO%20PowerShell%20or%20CSOM%2C%20or%20alternatively%20get%20a%20list%20of%20all%20the%20users%2C%20then%20for%20each%20user%20check%20for%20the%20presence%20of%20ODFB%20via%20the%20%2Fdrive%2Froot%20endpoint.%20Here's%20a%20sample%20script%20I%20wrote%20a%20while%20back%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmichevnew%2FPowerShell%2Fblob%2Fmaster%2FGraph_ODFB_shared_files.ps1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fmichevnew%2FPowerShell%2Fblob%2Fmaster%2FGraph_ODFB_shared_files.ps1%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1450188%22%20slang%3D%22en-US%22%3ERe%3A%20Graph%20api%20to%20list%20one%20drive%20for%20business%20users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1450188%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B.%20It%20was%20nice%20idea%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1451554%22%20slang%3D%22en-US%22%3ERe%3A%20Graph%20api%20to%20list%20one%20drive%20for%20business%20users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1451554%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F667335%22%20target%3D%22_blank%22%3E%40Desusai%3C%2FA%3E%26nbsp%3BThanks%20for%20your%20question%20and%20I'm%20glad%20you%20got%20it%20solved!%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3EFor%20future%20reference%2C%20you've%20posted%20your%20question%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FCommunity-Discussion%2Fbd-p%2FCommunityQuestions%22%20target%3D%22_blank%22%3ECommunity%20Discussion%20space%3C%2FA%3E%2C%20which%20is%20intended%20for%20discussion%20around%20the%20Tech%20Community%20website%20itself%2C%20not%20product%20questions.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI'm%20moving%20your%20question%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fmicrosoft-graph%2Fbd-p%2FOfficeGraph%22%20target%3D%22_self%22%3EMicrosoft%20Graph%20space%3C%2FA%3E-%20please%20post%20Microsoft%20Graph%20questions%20here%20in%20the%20future.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi ,

I am looking for an end point in microsoft graph api which could help me to list all the users in my azure ad who are having access to one drive for business. I have gone through many blogs and sites but i could not find any information on it. Can anyone here please help me with that!

 

Thanks in Advance :)

3 Replies
best response confirmed by Desusai (Occasional Contributor)
Solution

There's no single endpoint/query that can give you that information. You can either get the list via SPO PowerShell or CSOM, or alternatively get a list of all the users, then for each user check for the presence of ODFB via the /drive/root endpoint. Here's a sample script I wrote a while back: https://github.com/michevnew/PowerShell/blob/master/Graph_ODFB_shared_files.ps1

Thank you @Vasil Michev . It was nice idea

@Desusai Thanks for your question and I'm glad you got it solved!

For future reference, you've posted your question in the Community Discussion space, which is intended for discussion around the Tech Community website itself, not product questions.

 

I'm moving your question to the Microsoft Graph space- please post Microsoft Graph questions here in the future.