1

Hi guys :) I am trying to take all meeting from resource meeting box, but when i try to take subject like this $subject = $event->Subject it displays name by whom meeting was created. $request->ParentFolderIds->DistinguishedFolderId->Mailbox->EmailAddress = "mail@domain.com" This is code how i select resource meeting box.

I want to take meeting subject by other way and i will be glad if you will help me :)

$request = new EWSType_FindItemType();
// Use this to search only the items in the parent directory in question or use ::SOFT_DELETED
// to identify "soft deleted" items, i.e. not visible and not in the trash can.
$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;
// This identifies the set of properties to return in an item or folder response
$request->ItemShape = new EWSType_ItemResponseShapeType();
$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;
// Define the timeframe to load calendar items
$request->CalendarView = new EWSType_CalendarViewType();
$request->CalendarView->StartDate ='2014-03-28T15:00:00+04:00';// an ISO8601 date e.g. 2012-06-12T15:18:34+03:00   "Y-m-d\TH:i:sO"
$request->CalendarView->EndDate = '2015-03-28T15:00:00+04:00';// an ISO8601 date later than the above    "Y-m-d\TH:i:sO"

// Only look in the "calendars folder"
$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();
$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();
$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;
$request->ParentFolderIds->DistinguishedFolderId->Mailbox->EmailAddress = "meetingroom@gcfund.ge";

// Send request
$response = $ews->FindItem($request);
// Loop through each item if event(s) were found in the timeframe specified
if ($response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView > 0){
    $events = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem;


//       $db_selected = mysql_select_db('meeting_room',$con); 
//       $res=mysql_query("SELECT ID FROM meeting");
//       while($row = mysql_fetch_array($res)){
//       echo $row['ID'];
//       echo "<br>";
//       }
    foreach ($events as $event){

        $id = $event->ItemId->Id;
        $change_key = $event->ItemId->ChangeKey;
        $start = $event->Start;
        $end = $event->End;
        $subject = $event->Subject;
        $location = $event->Location;

This subject displays by whom meeting was created. I want this info too but i want Subject too.. Please Help :)

  • Your code looks correct. Can you `print_r($event);` inside your `foreach` loop to validate the entire event parameters? My only other suggestion at this point would be to change your `DefaultShapeNamesType` to `$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::ALL_PROPERTIES;` – ThomasEllis May 22 '14 at 20:01

1 Answers1

0

This is an issue with Exchange (not your code, or the PHP library, or EWS)

Several blogs, such as this one: http://www.slipstick.com/exchange/cmdlets/meeting-organizers-name-appears-in-subject-line/ indicate that you can perform some PowerShell commands to change the Exchange server configuration. Note that if you change the configuration, it will apply for all new meetings/appointments added after the configuration change (existing meetings/appointments will stay as-is).

If you don't have PowerShell access to the Exchange server but do have administrator access via another system, you might be able to achieve the same configuration change through the interface for that system. For example, on a Parallels hosted exchange system, login to Parallels as administrator, go to Exchange, go to Resource mailboxes, edit the room resource, and untick the "Add organizer to subject" checkbox under the "Resource scheduling" tab. As far as I can tell, this just performs the same PowerShell action behind the scenes.

There may be similar options in other systems (e.g. Office 365) though I haven't looked into that.

Having said all that, I have found that making this configuration change didn't help in my case: I created a new meeting against a room resource, however the subject ended up as "" (empty string) instead of the correct subject or the organiser's name. In any case, give the configuration change a try, as other people have apparently had success with it.

Gavin G
  • 856
  • 6
  • 6