1
votes

I am trying to get full meeting details from a Conference Room meeting. The below code works fine for a user's calendar but when I change the calendar to the meeting room (resource calendar) it doesn't return all of the information (specifically the meeting "Subject" and "Body".

The user that I'm using (in the credentials portion) has "Discovery Management" role as well as "Full Access" to the room calendar yet this still seems to point to permissions.

I also tried to add the following impersonation with no success:

ImpersonatedUserId uidSMTP = new ImpersonatedUserId(ConnectingIdType.SmtpAddress,”[email protected]");
service.setImpersonatedUserId(uidSMTP);

Any ideas would be much appreciated!

ExchangeService service = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials(“[email protected]", “Password”);
service.setCredentials(credentials);
service.setUrl(new URI("https://outlook.office365.com/EWS/Exchange.asmx"));
EmailAddress emAddr = new EmailAddress("[email protected]");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String td1 = "2015-12-23 15:00:00";
String td2 = "2015-12-23 23:00:00";
Date d1 = format.parse(td1);
Date d2 = format.parse(td2);
CalendarView cView = new CalendarView(d1,d2);
PropertySet prop = new PropertySet();
cView.setPropertySet(prop);
FolderId folderId = new FolderId(WellKnownFolderName.Calendar, new Mailbox(emAddr.getAddress()));
FindItemsResults<Appointment> findResults = service.findAppointments(folderId, cView);
ArrayList<Appointment> calItem = findResults.getItems();
PropertySet itemPropertySet = new PropertySet(BasePropertySet.FirstClassProperties); 
itemPropertySet.setRequestedBodyType(BodyType.Text);
int numItems = findResults.getTotalCount();
for (int i=0;i<numItems;i++) {
    Appointment Details = Appointment.bind(service, calItem.get(i).getId(),itemPropertySet);
    calItem.get(i).load();
    System.out.println(calItem.get(i).getOrganizer().getName());
    System.out.println(calItem.get(i).getStart());
    System.out.println(calItem.get(i).getEnd());
    System.out.println(calItem.get(i).getSubject());
    System.out.println(calItem.get(i).getDisplayTo());
    System.out.println(calItem.get(i).getLocation());
    System.out.println(Details.getBody());
}
1

1 Answers

0
votes

You might want to check the Meeting room yourself with Outlook as a security feature Exchange will change the Subject and remove the Body eg see https://technet.microsoft.com/en-us/library/dd335046(v=exchg.160).aspx and the aAddOrganizerToSubject and DeleteComments parameters which are enabled by default. This is to prevent sensitive meeting information from being accessed by anybody who has access to the Meeting room mailbox.

Cheers Glen