1

Exchange と統合するために php-ews ライブラリを使用しています。グローバル アドレス帳にアクセスする方法はないかと考えていました。ドキュメントを検索しましたが、何も表示されません。部屋のリソースを表示できるようにアクセスしたいと思います。

ありがとう

4

2 に答える 2

3

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-22T19:51:09.693 に答える