I am trying to access a group mailbox using the Exchange Web Services.
A domain account with full access to the group mailbox has been setup, but I am getting the following error:
When making a request as an account that does not have a mailbox, you must specify the mailbox primary SMTP address for any distinguished folder Ids.
My code is below:
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
service.UseDefaultCredentials = false;
service.Credentials = new WebCredentials("ServiceAccount", "<PASSWORD>");
//find web service url
service.AutodiscoverUrl("<GROUP MAILBOX EMAIL ADDRESS>", RedirectionUrlValidationCallback);
//find calendar ID
FolderId folderID = new FolderId(WellKnownFolderName.Calendar, new Mailbox("<GROUP MAILBOX EMAIL ADDRESS>"));
CalendarFolder calendar = CalendarFolder.Bind(service, folderID);
CalendarView view = null;
var propertySet = new PropertySet(
view = new CalendarView(DateTime.Now.AddMonths(-1), DateTime.Now.AddMonths(1));
view.PropertySet = propertySet;
var appointments = calendar.FindAppointments(view);
Is there any way of achieving this without setting up a mailbox for the service account?
When I run the above code with my credentials, there are no issues (I have full permission to the group mailbox, and a mailbox of my own).