php ews访问全局通讯簿
我正在使用PHPEWS库与exchange集成。我想知道是否有任何方法可以访问全球通讯簿,我搜索了文档,但什么都没有找到。我想访问它,以便查看房间资源php ews访问全局通讯簿,php,exchangewebservices,office365,php-ews,Php,Exchangewebservices,Office365,Php Ews,我正在使用PHPEWS库与exchange集成。我想知道是否有任何方法可以访问全球通讯簿,我搜索了文档,但什么都没有找到。我想访问它,以便查看房间资源 谢谢@Souljacker-EWS没有公开全球通讯簿。如果要查找房间资源,可以使用和。EWS从全局通讯簿中公开信息的唯一位置是通过和带有目录选项。我不认为php EWS中添加了GetRooms方法。看来他们只是放弃了发展。 看 作为一种解决方法,如果您的房间存在于Active Directory中,您可以执行LDAP查询以获取房间,然后使用房间的
谢谢@Souljacker-EWS没有公开全球通讯簿。如果要查找房间资源,可以使用和。EWS从全局通讯簿中公开信息的唯一位置是通过和带有目录选项。我不认为php EWS中添加了
GetRooms
方法。看来他们只是放弃了发展。
看
作为一种解决方法,如果您的房间存在于Active Directory中,您可以执行LDAP查询以获取房间,然后使用房间的电子邮件地址在每个房间中循环,以使用php ews获取其日历。否则,您可能会维护一个包含房间电子邮件地址的db列表,并在循环之前将其拉到那个里
一旦您有了房间的电子邮件地址,您就可以使用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的帐户将需要模拟权限
祝你好运