Can I use ews application to manage user exchange on-premise

Dino 80 Reputation points
2023-06-07T13:40:28.65+00:00

Hi,

I'm referring to this document https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-authenticate-an-ews-application-by-using-oauth#app-only-authentication (session App-only authentication code) to get all the folders of exchange on-premise users.

My exchange server has these users, one of them having type O365. User's image

It works well on user 3 with type O365, but with user_1, and user_2 which is in exchange on-premise. It throws an exception mailbox not found in this line. So I wonder If that this can only work with O365 email? Can someone confirm that for me? It will be a big help.

                var folders = ewsClient.FindFolders(WellKnownFolderName.MsgFolderRoot, new FolderView(10));
Exchange | Hybrid management
0 comments No comments
{count} votes

Accepted answer
  1. Andy David - MVP 157.8K Reputation points MVP
    2023-06-07T15:44:35.3866667+00:00

    The proof is in the document you linked:

    User's image

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Andy David - MVP 157.8K Reputation points MVP
    2023-06-07T13:56:47.1733333+00:00

    Correct, that will only work in Exchange Online


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.