Unlicensed OneDrive

JH 0 Reputation points
2024-11-05T23:27:57.63+00:00

Hi,

Has anyone found a way to undentiy unlicensed OneDrive accounts via Graph. Looking at these changes https://learn.microsoft.com/en-us/sharepoint/unlicensed-onedrive-accounts It would be great to identify what is about to be deleted.

Cheers

Josh

Microsoft Security | Microsoft Graph
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 124.7K Reputation points MVP Volunteer Moderator
    2024-11-06T07:22:48.34+00:00

    You can get the list of ODFB site (collections) via the LIST sites method (requires app permissions), then correlate it to the list of licensed users. There's also a built-in report within the SPO admin center, but unfortunately Microsoft has not exposed any method to get to it programmatically.

    0 comments No comments

  2. Anonymous
    2024-11-06T02:31:22.89+00:00

    Hello JH,

    Thank you for reaching out to Microsoft Support!

    You can use the List users endpoint to list unlicensed users as follows:

    However, other types of unlicensed OneDrive accounts are not listed, so it is recommended that you Get reports on unlicensed OneDrive accounts in the SharePoint admin center.

    Reports can also be obtained through the Graph Api, but there is no endpoint to implement this functionality, see the documentation for details.

    https://graph.microsoft.com/v1.0//users?$filter=assignedLicenses/$count eq 0&$count=true&$select=displayName,assignedLicenses
    ConsistencyLevel: eventual
    

    User's image

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.