我正在尝试使用以下脚本通过交换登录
ExchangeService Service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
Service.Credentials = new WebCredentials("abc", "123456","mydomain.net");
Service.TraceEnabled = true;
Service.UseDefaultCredentials = false;
Service.AutodiscoverUrl("[email protected]");
Folder inbox = Folder.Bind(Service, WellKnownFolderName.Inbox);
Console.WriteLine("The folder name is " + inbox.DisplayName.ToString());
我收到异常“无法找到自动发现服务”。此处用户名和密码正确。
我通过以下代码得到了答案。
ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.TraceEnabled = true;
service.Credentials = new WebCredentials("[email protected]", "123456");
service.AutodiscoverUrl("[email protected]", RedirectionCallback);
string url=service.url.toString();
现在我想获取与 Outlook 提供的日志和结果相同的信息。请提供获取信息的方法。
答案1
尝试Get-ClientAccessServer | Select Name, *Internal* | fl
在 Exchange Powershell 中运行以恢复 URL 的当前设置并将其发布在此处。
您是否已检查自动发现服务是否正常运行?转到https://testconnectivity.microsoft.com/并运行测试。