简体   繁体   中英

Avoid using Microsoft Exchange Service AutodiscoverUrl method

Some users for some reasons of remote machine are getting exception on AutodiscoverUrl() method call: Exception has been thrown by the target of an invocation at SystemRunTimeMethodHandle.InvokeMethod. InnerException: The user name or password is incorrect. How can we avoid using this method by filling properties manually, what properties do we need to fill except the URL of the service, if our exchange server's IP address is constant, we are using Microsoft.Exchange.WebServices Version 15.0.0.0 RunTimeVersion v2.0.50727 and all user are using Outlook 2016 Version 2110? Thanks for help.

All you should need is

service.Url = new Uri("https://computername.domain.contoso.com/EWS/Exchange.asmx");

As per "To set the Exchange service binding manually" in https://docs.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/dd633692(v=exchg.80)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM