none
getting last modifier from an invitation RRS feed

  • Question

  • Hi,

    I am trying to find out the last modifier of an appointment by using EWS, but i do not want to use actual appointment to get this instead i want to get it through as a property of  invitation sent. 

    is it possible? 

    Thanks

    Thursday, November 29, 2018 10:18 AM

All replies

  • Hi Nitrup,

    According to my search, you could refer to the below code:
    List<CalendarInfo> calendarEvents = new List<CalendarInfo>();
            ExchangeServiceBinding esb = EWS.Helper.ExchangeHelper.GetExchangeBinding(credentials);
            // Form the FindItem request.
            FindItemType findItemRequest = new FindItemType();
    
            CalendarViewType calendarView = new CalendarViewType();
            calendarView.StartDate = criteria.StartDateAndTime;
            calendarView.EndDate = criteria.EndDateAndTime;
            if (criteria.MaxItemsToReturn > 0)
            {
                calendarView.MaxEntriesReturned = criteria.MaxItemsToReturn;
                calendarView.MaxEntriesReturnedSpecified = true;
            }
            findItemRequest.Item = calendarView;
            //--
            PathToExtendedFieldType sySyncProp = new PathToExtendedFieldType();
    
            sySyncProp.PropertyTag = "0x3008";
            sySyncProp.PropertyType = MapiPropertyTypeType.SystemTime;
            // Define restrictions
            RestrictionType ffRestriction = new RestrictionType();
            IsGreaterThanOrEqualToType ieGreater = new IsGreaterThanOrEqualToType();
            ieGreater.FieldURIOrConstant =  new FieldURIOrConstantType();
            ieGreater.FieldURIOrConstant.Item = new ConstantValueType();
            (ieGreater.FieldURIOrConstant.Item as ConstantValueType).Value = DateTime.Now.AddDays(-1).ToUniversalTime().ToString("u");
            ieGreater.Item = sySyncProp;
            ffRestriction.Item = ieGreater;
           findItemRequest.Restriction = ffRestriction;
            //--
            // Define which item properties are returned in the response.
            ItemResponseShapeType itemProperties = new ItemResponseShapeType();
            // Use the Default shape for the response. 
            itemProperties.BaseShape = DefaultShapeNamesType.AllProperties;
            //insert last modified time value also to responses
            PathToExtendedFieldType[] ptufta = new PathToExtendedFieldType[1];
            ptufta[0] = new PathToExtendedFieldType();
            ptufta[0].PropertyTag = "0x3008"; //Property Tag for LastModifiedTime 
            ptufta[0].PropertyType = MapiPropertyTypeType.SystemTime;
            itemProperties.AdditionalProperties = ptufta;
            findItemRequest.ItemShape = itemProperties;
            DistinguishedFolderIdType[] folderIDArray = new DistinguishedFolderIdType[1];
            folderIDArray[0] = new DistinguishedFolderIdType();
            folderIDArray[0].Id = DistinguishedFolderIdNameType.calendar;
            if (!string.IsNullOrEmpty(criteria.EmailAddress))
            {
                folderIDArray[0].Mailbox = new EmailAddressType();
                folderIDArray[0].Mailbox.EmailAddress = criteria.EmailAddress.Trim();
            }
            findItemRequest.ParentFolderIds = folderIDArray;
            // Define the traversal type.
            findItemRequest.Traversal = ItemQueryTraversalType.Shallow;
            try
            {
                // Send the FindItem request and get the response.
                FindItemResponseType findItemResponse = esb.FindItem(findItemRequest);
                // Access the response message.
                ArrayOfResponseMessagesType responseMessages = findItemResponse.ResponseMessages;
                ResponseMessageType[] rmta = responseMessages.Items;
                int folderNumber = 0;
                foreach (ResponseMessageType rmt in rmta)
                {
                    // One FindItemResponseMessageType per folder searched.
                    FindItemResponseMessageType firmt = rmt as FindItemResponseMessageType;
                    if (firmt.RootFolder == null)
                        continue;
                    FindItemParentType fipt = firmt.RootFolder;
                    object obj = fipt.Item;
                    // FindItem contains an array of items.
                    if (obj is ArrayOfRealItemsType)
                    {
                        ArrayOfRealItemsType items = (obj as ArrayOfRealItemsType);
                        if (items.Items == null)
                        {
                            // Console.WriteLine("Folder {0}: No items in folder", folderNumber);
                            folderNumber++;
                        }
                        else
                        {
                            CalendarInfo ce;
                            CalendarItemType cal;
                            foreach (ItemType it in items.Items)
                            {
                                if (it is CalendarItemType)
                                {
                                    cal = (CalendarItemType)it;
                                    ce = GetCalendarInfo(esb, cal);
                                    calendarEvents.Add(ce);
                                }
                                //Console.WriteLine("Folder {0}: Item identifier: {1}", folderNumber, it.ItemId.Id);
                            }
                            folderNumber++;
                        }
                    }
                }
                //Console.ReadLine();
            }
            catch (Exception e)
            {
                throw;
            }
    
            return calendarEvents;

    If only Item or Restictions is defined for findItemRequest object it works.

    For more information, please refer to this link:

    You also can refer to this link:

    Best Regards,

    Alina

    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Friday, November 30, 2018 6:17 AM
  • Thanks for your response, but i do not think thats what i am looking for. let me explain my scenario

    user A creates a meeting in user B calendar and Send an invitation to Room/resource C. 

    Room/resource c has auto accept on so calendar will be update accordingly

    Now as my application subscribed notification for Room/resource c . so application will revive notification as new item will be added in C calendar. Now here i want to know who originally created this appointment or who actually sent this invitation by traversing the new appointment created in C calendar

    Thanks




    • Edited by Nitrup Friday, November 30, 2018 4:49 PM
    Friday, November 30, 2018 11:15 AM
  • Hi,

    Have you checked this link:

    How to find out when someone entered a meeting in Outlook Exchange 2010 calendar?


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Monday, December 3, 2018 9:55 AM
  • >Now as my application subscribed notification for Room/resource c . so application will revive notification as new item will be added in C calendar. Now here i want to know who originally created this appointment or who actually sent this invitation by traversing the new appointment created in C calendar

    So it sounds like your just talking about the Organizer have you tried just checking the organizer property on the Appointment. The Organizer will have the only writable copy of an Appointment even if an assistant is Sending on Behalf of. 

    Cheers
    Glen

    Monday, December 3, 2018 11:31 PM
  • HI Glen,

    Thanks for your reply

    I do not think i am looking for organizer of the meeting. in my scenario its user A who actually created an meeting in user B calendar.

    so here, User B is the organizer, but i need the information about User A who is actually creator of the meeting

    And that information i need when a resource revives a notification which in my case is room/resource C.

    Thanks

    Thursday, December 6, 2018 12:44 PM
  • I'd suggest you then check the objects in question with a MAPI Editor like OutlookSpy or MFCMapi. If you see a property that holds the value you need then just get that property using the extended property definition.

    Cheers
    Glen

    Thursday, December 6, 2018 10:32 PM