簡體   English   中英

如何使用EWS從會議室填寫約會詳細信息

[英]How to full appointment details from a meeting room using EWS

我正在嘗試從會議室會議中獲取完整的會議詳細信息。 下面的代碼適用於用戶的日歷,但是當我將日歷更改為會議室(資源日歷)時,它不會返回所有信息(特別是會議“主題”和“正文”)。

我正在使用的用戶(在憑據部分中)具有“發現管理”角色以及對會議室日歷的“完全訪問權限”,但是這似乎仍指向權限。

我還嘗試添加以下模擬,但均未成功:

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());
}

您可能希望使用Outlook作為安全功能自己檢查會議室Exchange將更改主題並刪除正文,例如,請參見https://technet.microsoft.com/zh-cn/library/dd335046(v=exchg.160) .aspx以及默認情況下啟用的aAddOrganizerToSubject和DeleteComments參數。 這是為了防止有權訪問會議室郵箱的任何人訪問敏感的會議信息。

干杯格倫

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM