Problem accessing items on different Exchange server than the server where account accessing is configured RRS feed

  • Question

  • I have an account created on Exchange Server A and I'm trying to access items on shared mailbox X configured on Exchange server B. I have required permissions to access mailbox X and I'm able to do it using MS Outlook, but not able to do it using EWS Managed API. I have used following code:

    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
    service.Credentials = new WebCredentials("", "password");
    service.Url = new Uri("");
    Mailbox somemailbox = new Mailbox("");
    FolderId folderInbox = new FolderId(WellKnownFolderName.Inbox, somemailbox);
    FindFoldersResults findResults = service.FindFolders(folderInbox, new FolderView(int.MaxValue));

    This returns an error: "The account accessing the resource must be on the same Mailbox Server version as the delegate account being accessed." pointing last line of the code (service.FindFolders).

    At the beginning I thought that version of the servers are not compatible, but when I changed "ExchangeVersion" in line 1 of the code to any other than "Exchange2007_SP1" I got error message "Exchange Server doesn't support the requested version.", so I guess that this is not version related problem. I guess that in such case I would not be able to connect using MS Outlook which works fine.

    I think that I'm missing something very easy, but I don't know what...

    Monday, January 21, 2013 12:44 PM

All replies