[英]Search Mailboxes in an Outlook Account using ExchangeService C#
I have an Office Outlook account with many additional Mailboxes. 我有一个带有许多其他邮箱的Office Outlook帐户。 Programmatically we need to read/download emails from each of those Mailboxes. 以编程方式,我们需要从每个邮箱中读取/下载电子邮件。 I tried the below code 我尝试了以下代码
service.Url = new Uri(url);
service.Credentials = new WebCredentials("user@domain.com", pName);
GetSearchableMailboxesResponse resp = service.GetSearchableMailboxes("quick", false);
foreach(SearchableMailbox mailbox in resp.SearchableMailboxes)
{
Console.WriteLine("DisplayName:" + mailbox.DisplayName);
Console.WriteLine("PrimarySmtpAddress:" + mailbox.SmtpAddress);
Console.WriteLine("ReferenceId:" + mailbox.ReferenceId);
Console.WriteLine("--------------------------------------------");
}
It shows an error at the line: 它在一行显示错误:
GetSearchableMailboxesResponse resp = service.GetSearchableMailboxes("quick", false);
Error: 错误:
The caller has not assigned any of the RBAC roles requested in the management role header.
It looks like some role/access permission need to be set to allow access to mailboxes. 似乎需要设置一些角色/访问权限才能允许访问邮箱。 Any help appreciated!!! 任何帮助表示赞赏!!!
EWS中的eDiscovery操作要求主叫用户具有发现管理RBAC,请参阅https://technet.microsoft.com/zh-cn/library/dd298059(v=exchg.160).aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.