The proof is in the document you linked:
Can I use ews application to manage user exchange on-premise
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.
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
1 additional answer
Sort by: Most helpful
-
Andy David - MVP 157.8K Reputation points MVP
2023-06-07T13:56:47.1733333+00:00 Correct, that will only work in Exchange Online