How to Fetch Mails From MS-Exchange Using Graph API?

Pavan Kushwaha 21 Reputation points
2021-06-01T12:17:36.07+00:00

Hi,

Can someone help me out that how I can fetch mails from Exchange User's mailbox using Microsoft Graph API?

Graph API is working fine for the online exchange users (O365) not for offline users (local users), but there is another problem too. Graph API provides Rest APIs by using which we can access each mailbox individually which will become very server loaded work if more than 1000K mailbox need to be scanned one by one and also a time taking process.

I want to fetch scan all user's mailbox at once both offline and online. Just like Microsoft Powershell do.

Is there any way to do so?

Any help will be deeply appreciated.

Thanks

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,247 questions
0 comments No comments
{count} votes

Accepted answer
  1. Glen Scales 4,431 Reputation points
    2021-06-01T23:31:21.167+00:00

    Using the Graph against OnPrem Mailboxes is still in preview see https://learn.microsoft.com/en-us/graph/hybrid-rest-support so you need some specific configuration and server requirements.

    Graph API is working fine for the online exchange users (O365) not for offline users (local users), but there is another problem too. Graph API provides Rest APIs by using which we can access each mailbox individually which will become very server loaded work if more than 1000K mailbox need to be scanned one by one and also a time taking process.

    If your comparing what you can do with the Graph against what you can do with Search-Mailbox and Compliance searches in Exchange Online/OnPrem you won't be able to match the performance those server side features are designed specifically for the purpose while the client API's like Graph are more for 1 to 1 client access of the Mailbox so things like throttling will always be a constraint. On the Exchange Online side things like Graph Data Connect https://learn.microsoft.com/en-us/graph/data-connect-concept-overview changes the paradigm and gives you easy access to Mailbox data at massive scale (but at cost).

    0 comments No comments

0 additional answers

Sort by: Most helpful