2

How to differentiate between user mailbox and shared mailbox from Microsoft Graph API explorer. I want to build app which should work with only shared mailboxes. Use of powershell is not possible due to limitation of basic authentication and we are not yet ready for modern authentication.

Manojkumar
  • 43
  • 6

2 Answers2

4

There is finally a property available in Graph Beta for the MailboxSettings object to check this:

Properties

Property Type Description
userPurpose userPurpose The purpose of the mailbox. Used to differentiate a mailbox for a single user from a shared mailbox and equipment mailbox in Exchange Online. Read only.

Source: https://learn.microsoft.com/en-us/graph/api/resources/mailboxsettings?view=graph-rest-beta#properties

Mr Quant
  • 104
  • 9
0

There seems not to be a way to differentiate shared mailboxes and normal user mailboxes with Microsoft Graph API explorer.

You could assign a keyword (like 'shared') as the givenName when creating shared mailboxes, or using the beta "findroomlists" outlook api endpoint.

See a similar post here.

Allen Wu
  • 15,529
  • 1
  • 9
  • 20
  • Thanks a lot Allen, I will try your suggestion. Along with shared mailbox, I wanted to filter out room and equipment mailboxes, but even for these mailboxes, "isResourceAccount" field is set to null. is there any way to get license usage from graph api? if yes, I can use it to filter out shared and resource mailboxes. – Manojkumar Mar 13 '20 at 13:54
  • 1
    @Manojkumar Sorry for the delay. I just came back to office. You can use `GET https://graph.microsoft.com/v1.0/users?$select=displayName,givenName,assignedLicenses` to filter the assignedLicenses of the user. – Allen Wu Mar 18 '20 at 08:49
  • @Manojkumarm If my answer is helpful for you, you can accept it as answer( click on the check mark beside the answer to toggle it from greyed out to filled in.). This can be beneficial to other community members. Thank you. – Allen Wu Mar 23 '20 at 09:18
  • 1
    To add to the comment above, a mailbox created as a shared mailbox will have an empty `assignedLicenses` list, but a user mailbox converted to a shared mailbox will have `assignedLicenses` populated with the same as before the conversion, so it's a good hint but not definitive – Richard Hunt Feb 26 '21 at 17:02