none
Global Object Id - how to get in EWS? RRS feed

  • General discussion

  • I am using EWS Managed API 2.1 and Exchange 2010. What will I have to request from Exchange server, and how do I convert it to string, to put it into AvailabilityOptions.GlobalObjectId?

    What I want to achieve and what I have done so far:
    To decide whether an appointment item in the Exchange database has a conflicting entry or not, I do a request on ExchangeService.GetUserAvailability(List<AttendeeInfo>, TimeWindow, AvailabilityData, AvailabilityOptions), with  AvailabilityOptions.GlobalObjectId set to Appointment.Id.UniqueId.
    This does not work - the Appointment is still listed in the returned results - presumably because UniqueId is different from GlobalObjectId.

    I did not find any specifications as to what a GlobalObjectId is, how it looks like, how to get it, and where else except for this single case it is used in any way in EWS (while it is used in Mapi all over the place). All I found was an ominous "ExtendedPropertyDefinition", which translated to 
    ExtendedPropertyDefinition globalObjectId = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Meeting, 35, MapiPropertyType.Binary)
    and should come as byte[], not string, while AvailabilityOptions.GlobalObjectId requires a string.

    I would like to propose that since a certain property has to be put there, one should find either a link to that property, a description how to get it or a link to the description how to get it, in your documentation at http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.availabilityoptions.globalobjectid(v=exchg.80).aspx

    Friday, September 12, 2014 2:41 PM

All replies

  • The GlobalObjectId would be the PidLidGlobalObjectId property http://msdn.microsoft.com/en-us/library/office/cc815676(v=office.15).aspx the format is documented in http://msdn.microsoft.com/en-us/library/ee157690(v=exchg.80).aspx

    The FreeBusy operation use the HexEntryId formats so you just need to convert the ByteArray to hex string to use eg

                PropertySet psPropSet = new PropertySet(BasePropertySet.FirstClassProperties);
                ExtendedPropertyDefinition PidLidGlobalObjectId = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Meeting, 0x3, MapiPropertyType.Binary);
                psPropSet.Add(PidLidGlobalObjectId);           
                appointment.Load(psPropSet);
                Byte[] goidByteVal;
                String goidString = "";
                if (clItems.Items[0].TryGetProperty(PidLidGlobalObjectId, out goidByteVal))
                {
                    goidString = BitConverter.ToString((Byte[])goidByteVal).Replace("-", "");
                }
                AvailabilityOptions oo = new AvailabilityOptions();
                oo.MeetingDuration = 60;
                oo.MaximumSuggestionsPerDay = 24;
                oo.GlobalObjectId = goidString;

    As far as I know using the GlobalObjectId will only affect the Meeting suggestions times returned not the FreeBusy Details or CalendarDetails.

    Cheers
    Glen

      
    Monday, September 15, 2014 2:41 AM