4

Our Exchange Admins (Exchange 2010 SP1) have setup a shared resource calendar. There is no mailbox assigned to this resource calendar. I want to be able to read the meetings using EWS and C#.

Snippet:

        ExchangeService esvc = new ExchangeService(ExchangeVersion.Exchange2010);
        esvc.Credentials = new WebCredentials(username, password, "ourplace.org");
        esvc.Url = new Uri("https://OWA.OURPLACE.ORG/EWS/Exchange.asmx");

        FolderId shareFolderId = new FolderId(WellKnownFolderName.Calendar, "Shared Calendar Name");
        CalendarFolder.Bind(esvc, shareFolderId);

the bind statement throws the error: "The SMTP address has no mailbox associated with it."

How can I read the items on a Share Resource Calendar that has no associated mailbox... or is it even possible?

Thanks !!

user2308563
  • 41
  • 1
  • 2
  • Hi @user2308563, did you find an answer? Tried answer below withou success.
    When right click My Calendar > myown@company.com > Properties under places it reads: \\myown@company.com
    On the other one it reads \\Jhon_Doe
    – jpfreire Jun 13 '17 at 14:10

2 Answers2

2

Bind to that Calendar with a mail-Adress

Create first of all a FolderId:

FolderId parkplatzCalendarId = new FolderId(WellKnownFolderName.Calendar,"de.calendar.name@company.com");

Then bind to this one:

CalendarFolder calendar = CalendarFolder.Bind(_service, parkplatzCalendarId);

Now you can use this calendar!

CalendarView cView = new CalendarView(start, end, int.MaxValue);

cView.PropertySet = new PropertySet(AppointmentSchema.Subject, AppointmentSchema.Start, AppointmentSchema.End, AppointmentSchema.Duration, AppointmentSchema.LastModifiedName, AppointmentSchema.Organizer, AppointmentSchema.Categories);

FindItemsResults<Appointment> appointments = calendar.FindAppointments(cView);

With something like that ;D

James Vornhagen
  • 172
  • 1
  • 11
  • 1
    It's also important to note that the user you're logged in as needs delegate access to that resource calendar. I just had a two hour run in with that permissions issue. – BCza Jul 16 '14 at 16:50
  • Worked as said, connected with a user that had delegate access, then created folderId object with an e-mail format of the calendar: delegaceCal@company.com – jpfreire Jun 13 '17 at 15:20
0

If the calendar is actually not in any particular mailbox, then it should be in a public folder, and you should look in a subfolder WellKnownFolderName.PublicFoldersRoot.

Otherwise, please tell where exactly does it appear in Outlook folders hierarchy.

Victor Sergienko
  • 13,115
  • 3
  • 57
  • 91