我正在尝试使用用户兑换来更新用户的 Outlook 联系人。我正在影响的用户在 exchangeUser 中传递,称他为“目标用户”。当我以我自己的身份运行它时,此代码有效:
public OutlookFolders(string outlookRootFolder, string exchangeUser, string mailServer)
{
var session = new RDOSessionClass();
session.LogonExchangeMailbox(exchangeUser, mailServer);
session.Stores.FindExchangePublicFoldersStore();
var store = session.GetSharedMailbox(exchangeUser);
//...
}
我试图以第三个用户“测试用户”的身份登录,他不是我,也不是“目标用户”。当我的程序到达 FindExchangePublicFoldersStore 时,我的程序会在运行时显示密码提示,如果我不填写我的凭据,它会失败并出现错误:
System.Runtime.InteropServices.COMException (0x8004011D): Error in
IMAPISession.OpenMsgStore(pbExchangeProviderPrimaryUserGuid):
MAPI_E_FAILONEPROVIDER
ulVersion: 0
Error: Microsoft Exchange is not available. Either there are network
problems or the Exchange computer is down for maintenance.
Component: Microsoft Exchange Information Store
ulLowLevelError: 2147746069
ulContext: 1318
我尝试授予“目标用户”邮箱和联系人文件夹的“测试用户”所有者权限。似乎没有什么不同。需要设置哪些其他权限才能使其正常工作?