php-ews访问全球通讯簿 [英] php-ews Access Global Address Book

查看:83
本文介绍了php-ews访问全球通讯簿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用php-ews库与Exchange集成.我想知道是否有任何方法可以访问全局通讯簿,但是我已经搜索了文档,但没有任何反应.我想访问它,以便查看房间资源.

I'm working with the php-ews library to integrate with exchange. I was wondering if there was any way to access the global address book, I've searched the documentation and nothing comes up. I would like to access it so I can view room resources.

谢谢

推荐答案

我认为GetRooms方法从未添加到php-ews中.看来他们只是退出开发. 请参阅. https://github.com/jamesiarmes/php-ews/issues/91

I don't think that the GetRooms method was ever added to php-ews. It seems they just quit development. see.. https://github.com/jamesiarmes/php-ews/issues/91

作为一种解决方法,如果您的会议室存在于Active Directory中,则可以执行LDAP查询以获取会议室,然后使用会议室的电子邮件地址遍历每个会议室,以使用php-ews获取日历.否则,您可以在房间的数据库列表中保留其电子邮件地址,并在循环之前将其拉出.

As a workaround, if your rooms exist in Active Directory, you could do an LDAP query to get the rooms and then loop through each room using the email address of the room to get it's calendar with php-ews. Otherwise, you could possibly maintain a db list of the rooms with their email addresses and pull them that way before looping.

一旦有了会议室的电子邮件地址,就可以使用Exchange模拟,模拟会议室的电子邮件来检查日历.

Once you have the rooms' email addresses, you'd use Exchange impersonation, impersonating the email of the room to check it's calendar.

类似这样的事情...

Something like this...

// 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的帐户将需要模拟特权.

where you supply the $email and $start and $end. NOTE: the account you access the EWS API with will require impersonation privileges.

祝你好运.

这篇关于php-ews访问全球通讯簿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆