I'm having an application which keeps track of appointments in Exchange using the EWS API. Using the property .ItemId is bad, because though it's unique, it's likely to change (Exchange web services: why is ItemId not constant? [continued]). For tracking items, this is a bad situation. Therefore I use the property Appointment.ICalUid.
This property also doesn't always looks the same and as far I can see, it somehow changes. I've logged some changes. At first a record is created with the following .ICalUID:
5fc22493-7212-4c44-9cd6-971c3bae28af
Then the next time I look up the records in Exchange the same item returns another .ICalUID:
040000008200E00074C5B7101A82E00800000000F01883C1D49AD101000000000000000010000000C321E8A40C6DE948836C422E2DA8610C
Why do I have at first a string returned of 36 characters and later on a string of 190 characters long? Why is this value changing?
Edit: That the short id is created when using an Android phone connected to the Exchange Server, and the long ID is created using Outlook on Windows 10 with Outlook 2013. But it changes somehow?
This is because the RFC for iCal doesn't define the format or length of the Uid https://www.rfc-editor.org/rfc/rfc5545 just that it has to be globally unique. That means its down to implementer eg some people use a guid, some use a guid and domain etc. Exchange/Outlook uses a GOID format in particular PidLidCleanGlobalObjectId https://msdn.microsoft.com/en-us/library/office/cc839502.aspx and PidLidGlobalObjectId https://msdn.microsoft.com/en-us/library/office/cc815676.aspx (which are typically generated by the Exchange server when the appointment is created) .
So you should expect different formats and I generally recommend you use the PidLidCleanGlobalObjectId extended property rather then the icaluid property because this will always returns consistent as once its set Exchange will never change this property where the strongly typed property can be inconsistent in certain cases like you seeing. (as a general rule it should return the GOID).
Cheers Glen