Appointment.Sensitivity not updating after modification to the appointments Private switch
I create a private (check Mark As Private) meeting in OWA

Using GetAppointment I query for the meeting and retrieve it with the proper Sensitivity value of Private


       
 public Appointment GetAppointment(ItemEvent itemEvent)
        {
            Appointment appointment;
            try {
                appointment= Appointment.Bind(exchangeService, itemEvent.ItemId.ToString());
                ExtendedPropertyDefinition prop = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x8238, MapiPropertyType.String);
                PropertySet psPropset = new PropertySet(BasePropertySet.FirstClassProperties) { AppointmentSchema.Subject,AppointmentSchema.Body, prop };                
                appointment.Load(psPropset);
            } catch (Exception ex) {
                Logger eventLogger = new Logger();
                eventLogger.WriteToEventLog(true, 108, "ExchangeDataAccess error GetAppointment: " + ex.Message);
                appointment = null; ;
            }
            return appointment;
        }


Go back to OWA and edit the meeting so that it is NOT private.  Run the same GetAppointment for that meeting again but the Sensitivity value is still Private even though it should be `Normal`

FYI:
Its whenever the meeting changes from Private to Normal that Sensitivity is not updated.  The reverse does properly update the Sensitivity [going from Normal to Private].

  • Edited by owen gerig Friday, June 20, 2014 7:53 PM
June 20th, 2014 10:51pm

What version/servicepack/rollup of Exchange are you using ?

Have you tried looking that the raw values of the property using a MAPI editor like OutlookSpy of MFCMapi ?

The other thing to test is look at the extended property value rather then the strong types to see if that makes a differance eg

        ExtendedPropertyDefinition PR_SENSITIVITY = new ExtendedPropertyDefinition(0x0036, MapiPropertyType.Integer);
        var propertiesToLoad = new PropertySet(BasePropertySet.FirstClassProperties) { RequestedBodyType = Microsoft.Exchange.WebServices.Data.BodyType.Text };
        propertiesToLoad.Add(PR_SENSITIVITY);
        service.LoadPropertiesForItems(items, propertiesToLoad);
        foreach (Appointment aptval in items)
        {
            Int32 SensVal = 0;
            if (aptval.TryGetProperty(PR_SENSITIVITY, out SensVal))
            {
                switch(SensVal){
                    case 0 : Console.WriteLine("SENSITIVITY_NONE");
                        break;
                    case 1 : Console.WriteLine("SENSITIVITY_PERSONAL");
                        break;
                    case 2 : Console.WriteLine("SENSITIVITY_PRIVATE");
                        break;
                    case 3 : Console.WriteLine("SENSITIVITY_COMPANY_CONFIDENTIAL");
                        break;
                }
            }               
        }

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
June 23rd, 2014 8:00am

currently testing with exchange 2013 (Version 15.0 (Build 775.38))

I tried to do the above, which i had found here

But I couldn't figure out how to feed it an appointment

 I use

FindItemsResults<Appointment> findAppointmentResults = calendar.FindAppointments(cView);

So I dont have a list of Items to use the code above

I have tried to cast as well as creating my own 

FindItemsResults<Item> fir = new FindItemsResults<Item>();

but you cannot Add the appointment objects because its not mutable

June 23rd, 2014 12:23pm

You may want to consider updating to SP1 and RU5 as there are a lot of fixes especially in SP1 for a number of things.

For using LoadPropertiesForItems and FindAppointment see http://blogs.msdn.com/b/exchangedev/archive/2010/03/16/loading-properties-for-multiple-items-with-one-call-to-exchange-web-services.aspx

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
June 24th, 2014 12:41am

I tried this

public void loadExtendedPrivProperty(Appointment appt) {
            ExtendedPropertyDefinition PR_SENSITIVITY = new ExtendedPropertyDefinition(0x0036, MapiPropertyType.Integer);
            var propertiesToLoad = new PropertySet(BasePropertySet.FirstClassProperties) { RequestedBodyType = Microsoft.Exchange.WebServices.Data.BodyType.Text };
            propertiesToLoad.Add(PR_SENSITIVITY);
            appt.Load(propertiesToLoad);
                Int32 SensVal = 0;
                appt.TryGetProperty(PR_SENSITIVITY, out SensVal);
 
            //            case 0: Console.WriteLine("SENSITIVITY_NONE");
            //            case 1: Console.WriteLine("SENSITIVITY_PERSONAL");
            //            case 2: Console.WriteLine("SENSITIVITY_PRIVATE");
            //            case 3: Console.WriteLine("SENSITIVITY_COMPANY_CONFIDENTIAL");
        }

however the SensVal is always 2 (provided it was originally set to Private/2)

Can you test this?  Is this a bug with EWS?

It seems that once an Appointment gets set to Private, it will never change even if the Appointment is editted and that property is changed.

FYI:

I also installed CU5 on the Exchange server.  So it should be up to date now.

June 25th, 2014 7:20pm

I can't reproduce the issue your having (not on office365 anyway), have you tried looking at the raw properties in a Mapi editor life MFCMapi configured with a profile in Online mode ? this is ultimate test because you will see to properties in real time, ews is just reading those same store properties.

If your using the Managed API to read the values of that property are you reloading the Item when the change is made eg say if you read the property from an Item with the Managed API and then went into OWA and made a change to that Item you will need to reload the Item (eg do a GetItem or Load) again with the managed API to see the change. The Managed API's strongly typed object won't show changes in real-time you always need to use the Load() method to cause the API to perform an operation to get the updated data from the server.

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
June 26th, 2014 3:24am

the code above shows the .Load being called, is that not what your referring to?  And isnt that extended property quering the mapi directly?  it seems to parse correctly (values are what they should be, prior to any modifications to the appointment)

I tried to work with MFCMapi but couldnt get it configured on the server nor on my personal machine.  


  • Edited by owen gerig Sunday, June 29, 2014 2:23 PM
June 29th, 2014 5:23pm

>>the code above shows the .Load being called, is that not what your referring to?

Yes but my point is that you need to call this every time you want to read the updated information. EWS, Outlook and OWA all read the same properties you should be able to configured an Outlook profile against your Exchange server to test MFCMapi with. Have you just tried testing it with Outlook instead of OWA ? .     

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
June 30th, 2014 8:54am

(sorry for late reply).  i have not tested it with outlook

and the call to load is called every time prior to the use/checking of that private flag

July 7th, 2014 12:32pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics