本周早些时候,当我更改了域密码时,我的代码片段完美无缺。之后,尝试使用GetSharedMailbox
打开共享邮箱时,收到错误Could not find the store DN
。现在,真正奇怪的是,这只发生在一台机器上(不幸的是,我真的需要它运行的机器)。它适用于我的开发笔记本电脑。两台机器都已重新启动,并从那时起重新登录。
两台计算机都登录到我的帐户下的Windows AD域,并且访问其他域资源时没有任何问题。我可以毫无问题地打开问题机器上的Outlook,并查看我的个人收件箱和共享邮箱。问题机器上的远程调试显示它打开了与Exchange确定的连接(rdo.Logon
有效,我可以遍历其对象)。当我尝试打开共享邮箱时抛出错误。
欢迎任何建议!
Try
Dim rdo as RDOSession = New RDOSession
rdo.Logon()
Dim sharedBox As RDOStore = rdo.GetSharedMailbox("SharedMailbox@domain.com") 'Throws error here
inbox = sharedBox.GetDefaultFolder(rdoDefaultFolders.olFolderInbox)
Console.WriteLine(String.Format("Mailbox: {0} ({1})", sharedBox.Name, sharedBox.EntryID))
' Do a bunch of stuff with inbox.Items
Catch err As Exception
My.Application.Log.WriteException(err, TraceEventType.Error, "Error connecting to mail server")
End Try
答案 0 :(得分:0)
错误通常意味着Redemption没有凭据来检索自动发现XML并配置与委托邮箱的连接。如果您使用LogonHostedExchangeMailbox
而不是Logon
,则赎回将使用指定的凭据。否则,您可以使用RDOSession.Creadentials.Add
缓存凭据。