Hi, we are developing an application on premises using .NET. We have mailboxes on premises and mailboxes on Office365, and Azure AD Sync is in place.
From within the .net app, we want to query the Microsoft Graph, and ask a simple question: Give this SPN for the user, does he have mailbox in Office 365 or not.
How can we achieve this using the Microsoft graph?
How about this? Check the assignedLicenses property of the user object. If an Exchange Onine license assigned, you can assume that there is a mailbox for the user.