1

我正在尝试从会议室会议中获取完整的会议详细信息。下面的代码适用于用户的日历,但是当我将日历更改为会议室(资源日历)时,它不会返回所有信息(特别是会议“主题”和“正文”。

我正在使用的用户(在凭据部分)具有“发现管理”角色以及对房间日历的“完全访问权限”,但这似乎仍然指向权限。

我还尝试添加以下模拟但没有成功:

ImpersonatedUserId uidSMTP = new ImpersonatedUserId(ConnectingIdType.SmtpAddress,”MeetingRoom@Domain.com");
service.setImpersonatedUserId(uidSMTP);

任何想法将不胜感激!

ExchangeService service = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials(“User@Domain.com", “Password”);
service.setCredentials(credentials);
service.setUrl(new URI("https://outlook.office365.com/EWS/Exchange.asmx"));
EmailAddress emAddr = new EmailAddress("MeetingRoom@Domain.com");
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());
}
4

1 回答 1

0

您可能希望使用 Outlook 自己检查会议室作为一项安全功能 Exchange 将更改主题并删除正文,例如参见https://technet.microsoft.com/en-us/library/dd335046(v=exchg.160) .aspx以及默认启用的 aAddOrganizerToSubject 和 DeleteComments 参数。这是为了防止任何有权访问会议室邮箱的人访问敏感的会议信息。

干杯格伦

于 2015-12-21T05:54:17.800 回答