Determine if a User has a Drive through Graph API?

Adz 286 Reputation points
2023-01-24T10:41:14.3833333+00:00

I am attempting to get a Users Drive through the graph API, however

[https://learn.microsoft.com/en-us/graph/api/drive-get?view=graph-rest-1.0&tabs=http#get-a-users-onedrive

"If a user's OneDrive is not provisioned but the user has a license to use OneDrive, this request will automatically provision the user's drive, when using delegated authentication."

The Drive would get provisioned automatically if I do a get on /users/{id}/drive

Is there a way to determine if a User has a Drive without a user's Drive getting provisioned automatically.

If there isn't a way without provisioning one, will the GET /users/{id}/drive and automatic provisioning incur an extra fee on my company?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,445 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,300 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2023-01-24T12:54:28.08+00:00

    Hi @Adz,

    Thanks for reaching out!

    Currently there isn't any way to check the users drive without provisioning and automatic provisioning does not incur any extra charges on the company if you already have a OneDrive license associated with the user.

    Hope this helps.

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

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Mikael Svenson 1 Reputation point
    2024-06-06T08:22:53.93+00:00

    You can use this on the beta endpoint:

    https://graph.microsoft.com/beta/me/profile/webAccounts?$filter=webUrl ne null&$top=1&select=webUrl 
    

    if no URL comes back, the user has not provisioned ODB

    0 comments No comments