我正在使用php-ews库来集成exchange。我想知道是否有任何方法可以访问全球地址簿,我搜索了文档,但没有找到。我想访问它,这样我就可以查看房间资源。
谢谢
发布于 2014-05-23 03:51:10
我不认为GetRooms方法曾经被添加到php-ews中。看起来他们只是退出了开发。看..。https://github.com/jamesiarmes/php-ews/issues/91
作为一种解决办法,如果您的房间存在于Active Directory中,您可以执行LDAP查询来获取房间,然后使用房间的电子邮件地址遍历每个房间,以使用php-ews获取其日历。否则,您可以维护一个包含房间电子邮件地址的数据库列表,并在循环之前将其拉入其中。
一旦你有了房间的电子邮件地址,你就可以使用Exchange模拟,模拟房间的电子邮件来检查它的日历。
就像这样..。
// 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所使用的帐户将需要模拟权限。
祝好运。
发布于 2014-05-07 05:52:16
@Souljacker - EWS不公开全局通讯簿。如果您想查找房间资源,可以使用GetRoomLists operation和GetRooms operation。EWS只能通过带有目录选项的ResolveNames operation和FindPeople operation公开全球通讯簿中的信息。
https://stackoverflow.com/questions/23407963
复制相似问题