首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >php-ews Access全球通讯簿

php-ews Access全球通讯簿
EN

Stack Overflow用户
提问于 2014-05-01 20:46:24
回答 2查看 1.6K关注 0票数 1

我正在使用php-ews库来集成exchange。我想知道是否有任何方法可以访问全球地址簿,我搜索了文档,但没有找到。我想访问它,这样我就可以查看房间资源。

谢谢

EN

回答 2

Stack Overflow用户

发布于 2014-05-23 03:51:10

我不认为GetRooms方法曾经被添加到php-ews中。看起来他们只是退出了开发。看..。https://github.com/jamesiarmes/php-ews/issues/91

作为一种解决办法,如果您的房间存在于Active Directory中,您可以执行LDAP查询来获取房间,然后使用房间的电子邮件地址遍历每个房间,以使用php-ews获取其日历。否则,您可以维护一个包含房间电子邮件地址的数据库列表,并在循环之前将其拉入其中。

一旦你有了房间的电子邮件地址,你就可以使用Exchange模拟,模拟房间的电子邮件来检查它的日历。

就像这样..。

代码语言:javascript
复制
// Configure impersonation using the conference OwnerEmailAddress
    $ei = new EWSType_ExchangeImpersonationType();
    $sid = new EWSType_ConnectingSIDType();
    $sid->PrimarySmtpAddress = $email;
    $ei->ConnectingSID = $sid;
    $ews->setImpersonation($ei);
    // Set the search for calendar item types   
    $request = new EWSType_FindItemType();
    $request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;
    $request->ItemShape = new EWSType_ItemResponseShapeType();
    $request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::ALL_PROPERTIES;
    $request->CalendarView = new EWSType_CalendarViewType();
    // Set the instance start and end times 
    $request->CalendarView->StartDate = $start->format('Y-m-d\TH:i:s'); 
    $request->CalendarView->EndDate = $end->format('Y-m-d\TH:i:s');
    // Set the search location as the calendars folder of the impersonated user
    $request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();
    $request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();
    $request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;
    $request->ParentFolderIds->DistinguishedFolderId->Mailbox->EmailAddress = $email; 
    // Execute the search
    $response = $ews->FindItem($request);

其中,您提供$email$start$end。注意:您访问EWS API所使用的帐户将需要模拟权限。

祝好运。

票数 3
EN

Stack Overflow用户

发布于 2014-05-07 05:52:16

@Souljacker - EWS不公开全局通讯簿。如果您想查找房间资源,可以使用GetRoomLists operationGetRooms operation。EWS只能通过带有目录选项的ResolveNames operationFindPeople operation公开全球通讯簿中的信息。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23407963

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档