1

I have an Office Outlook account with many additional Mailboxes. 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!!!

Cloud9
  • 11
  • 4

1 Answers1

2

The eDiscovery Operations in EWS requires that the calling user has the Discovery Management RBAC see https://technet.microsoft.com/en-us/library/dd298059(v=exchg.160).aspx

Glen Scales
  • 20,495
  • 1
  • 20
  • 23