GRAPH API TO ACCESS INBOX OF ALL USERS AT ONCE MS-EXCHANGE SERVER

Pavan Kushwaha 21 Reputation points
2021-04-24T06:20:43.887+00:00

I have MS-Exchange server deployed on my server where there are different types of users (locally or hybrid). The users can be seen on admin.microsoft.com (outlook admin panel) but when I try to access the mailbox of users which are locally saved, an error I am getting in response of the GRAPH API -

{
"error": {
"code": "MailboxNotEnabledForRESTAPI",
"message": "REST API is not yet supported for this mailbox."
}
}

And also, Is there any way that I can search mails in all user's mailbox at once. I found something regarding this "Message Trace", available in outlook admin panel (API -https://reports.office365.com/ecp/reportingwebservice/reporting.svc/MessageTrace) which do the work for me but it requires Basic Auth implementation which I don't want to do. I want to authorize the API request using Oauth access token. Is there any way?

Any help will be really appreciated.

Thanks In Advance

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,356 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Eric Yin-MSFT 4,386 Reputation points
    2021-04-26T02:52:50.07+00:00

    Hi,
    You cannot use the API if your mailbox is not on Exchange Online. Can you confirm if the mailbox is on-premises or on Exchange Online?
    If you want to search something in a user's mailbox, you can use mailbox search:
    New-ComplianceSearch: how to use the newer version of Search-Mailbox
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Pavan Kushwaha 21 Reputation points
    2021-04-26T05:00:56.073+00:00

    Hi,

    The mailbox is on-premises.

    The link which you have shared is great but I don't want to dive into powershell and searching for REST APIs which I can use to get my work done. Is there any?

    I have also mentioned about message-trace in my question. Can you please describe me a little on that too.

    Thanks


  3. Pavan Kushwaha 21 Reputation points
    2021-05-04T13:25:17.317+00:00

    Hi,

    Thanks for the reply. It's really helpful.

    And also, I tried to reach Microsoft support but did't got reply from the team. Is there any another way that I can connect to the the support team.

    Thanks & Regards