I'm creating an app that needs to get the permissions for each MailBox, and I can't seem to get it to work. I've noticed in the VS Object Browser that the Permissions property is on the Folder class.
So I'm guessing I need to get the MailBox object and then get the root/default folder so I can get the Permissions.
This is what I've done so far, but when it calls Folder rootfolder = Folder.Bind(service, sharedMailboxRootFolderId);
I get the following exception:
"The Client Access Server version does not match the accessed resource's Mailbox Server version."
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
string exchangeServerWebServicesUrl = "https://example.com/EWS/Exchange.asmx";
service.Url = new Uri(exchangeServerWebServicesUrl);
string username = "*********************";
string password = "*********************";
service.UseDefaultCredentials = false;
service.Credentials = new WebCredentials(username, password);
Mailbox sharedMailbox = new Mailbox("[email protected]");
FolderId sharedMailboxRootFolderId = new FolderId(WellKnownFolderName.Root, sharedMailbox);
Folder rootfolder = Folder.Bind(service, sharedMailboxRootFolderId);
var permissions = rootfolder.Permissions;
I've tried passing in different ExchangeVersion enum values, but they don't work either. But passing ExchangeVersion.Exchange2007_SP1 does work when I try and get the Public Folders root folder.
Folder rootfolder = Folder.Bind(service, WellKnownFolderName.PublicFoldersRoot);
So the question is how can I get a MailBoxes permissions using EWS?