0

I am using Redemption to access the shared mailboxes. The Logon method that I am using is Session.LogonExchangeMailbox.

It seems to be working fine as long as I do not try to access the shared mailbox. Once I am trying to access shared mailbox, there is the following error:

Redemption.RDOStores: Could not find the store DN Could not retrieve autodiscover XML: GetAutodiscoverForEmailAddress: There are no autodiscover servers in the AD for this address Error in WinHttpSendRequest(bcg.com/autodiscover/autodiscover.xml): ERROR_WINHTTP_TIMEOUT Error in WinHttpSendRequest(bcgcloud.mail.onmicrosoft.com/autodiscover/autodiscover.xml): ERROR_WINHTTP_NAME_NOT_RESOLVED Error in WinHttpSendRequest(autodiscover.bcgcloud.mail.onmicrosoft.com/autodiscover/autodiscover.xml): ERROR_WINHTTP_CANNOT_CONNECT HTTP error 401 from https://autodiscover-s.outlook.com/autodiscover/autodiscover.xml

What I tried:

  1. adding credentials with RDO.Credentials.add - does not change anything
  2. LogonHostedExchangeMailbox - does not work in my case at all - I guess because of Basic Auth being disabled (and I cannot get OAuth token for modern auth)

Checking the server version with Session.ExchangeMailboxServerVersion has shown that we have 15.20.4995.8 - looks like we have Exchange 2019 where RPC-Over-HTTP is not supported anymore. Then the question would be how could Session.LogonExchangeMailbox work at all even with DefaultFolder? Why does it error out only in case, if I am trying to access sharedmailbox?

Thanks.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
Nik Ohler
  • 75
  • 9

2 Answers2

0

It seems your choice is only the LogonHostedExchangeMailbox method. Here is what the author of Redemption wrote:

LogonExchangeMailbox creates a temporary profile that uses plain RPC connection. Exchange 2013 and 2016 do not support RPC connections anymore, only RPC-over-HTTP or MAPI-over-HTTP. You need to use LogonHostedExchangeMailbox for that.

See What is a RDOSession.LogonExchangeMailbox server name for outlook.com? for more information.

In case of Exchange profiles/accounts I'd suggest using EWS instead. See Explore the EWS Managed API, EWS, and web services in Exchange for more information. Also you may consider using the Graph API.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
0

Redemption needs to retrieve autodiscover XML before it can open a shared mailbox. In most cases, autodiscover retrieval should still work with basic authentication, but opening the actual mailbox woudl still require OAuth token if basic auth is disabled. Is your code running in a COM addin or a standalone app?

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Thanks for your answer. As standalone app. – Nik Ohler Feb 15 '22 at 16:34
  • There is not much you can do in a standalone app. If running inside Outlook (COM addin) Redemption can at least intercept Outlook calls and extract OAuth tokens, but there is nothing it can do in a standalone app unless you give it an OAuth token. – Dmitry Streblechenko Feb 15 '22 at 17:12