How to Check If User Has Valid Mailbox?

WillBurner-4298 21 Reputation points
2023-04-20T00:45:16.12+00:00

I am calling the list users API call, but I would like to exclude any user that doesn't have a valid Office 365 mailbox. Is there a way to do this? Basically the same question as https://learn.microsoft.com/en-us/answers/questions/472337/find-if-a-user-has-a-mailbox-or-not-using-graph-ap

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-04-21T05:15:38.64+00:00

    Hello WillBurner-4298,

    Thanks for reaching out!

    As per my research you can get details of a user with a valid mailbox having a default Exchange online plan by using the MS Graph API endpoint:
    GET /users/{id|userPrincipalName}/mailboxSettings

    Permissions required to run this API: MailboxSettings.ReadWrite

    If the user has a mailbox, the API will return a JSON object that includes the mailbox settings for the user, including the mailboxGuid, archiveGuid, and outlook, among others. Please refer the link for more details.

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


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.