none
Exchange meeting resources are always null while retrieving meeting from the resource mailbox. RRS feed

  • Question

  • I am a new bee in Exchange and facing an issue that the meeting resources are always null while retrieving meeting from resource mailbox.

    Question: how can I get the meeting resources from resource mailbox or owner mailbox as I don’t have permissions on owner mailbox but have permissions on the resources mailbox?

    Details: I have resource pull subscription and EWS user has permissions on the resources mailbox. So, whenever meeting is received in resource mailbox, based on pull notification I am able to retrieve meeting details from the resource mailbox but I am not getting all resources in the meeting details, it is always null.  In a jest, I am trying to get all participants details of the meeting where I am one of the participants.

    I am using Exchange 2007.

    Appreciate your suggestions or other approach for the same.

    Friday, November 25, 2011 10:24 AM

All replies

  • Other then accessing the organizer calendar (which you will need rights for) you could use the the PidLidAllAttendeesString property http://msdn.microsoft.com/en-us/library/cc815418.aspx on the appointment Item which contains the displayname of the attendees bar the organizer. (If you then need the email addresses of the attendees use resolve-name)


    Cheers
    Glen

    Monday, November 28, 2011 2:49 AM
  • Thank you Glen for your support
    I tried the property PidLidAllAttendeesString but I could not get the desired the result. I tried two different methods to retrieve the attendees. Please see the below code.

    EWS 2007 GetItem method:
    GetItemType getItemRequest = new GetItemType ();
    getItemRequest.ItemIds = new ItemIdType[] { item };
    getItemRequest.ItemShape = new ItemResponseShapeType ();
    getItemRequest.ItemShape.BaseShape = DefaultShapeNamesType.AllProperties;
    getItemRequest.ItemShape.BodyType = BodyTypeResponseType.Text;
    getItemRequest.ItemShape.BodyTypeSpecified = true;

    PathToExtendedFieldType pathClassification = new PathToExtendedFieldType ();
    pathClassification.DistinguishedPropertySetId =
    DistinguishedPropertySetType.Appointment;
    pathClassification.DistinguishedPropertySetIdSpecified = true;
    pathClassification.PropertyId = 0x8238;// 0x8259;// 0x8186;//; //0x001D;
    pathClassification.PropertyType = MapiPropertyTypeType.String;

    getItemRequest.ItemShape.AdditionalProperties = new BasePathToElementType[1];
    getItemRequest.ItemShape.AdditionalProperties[0] = pathClassification;
                   
    itemResponse = exchangeServiceBinding.GetItem ( getItemRequest );

    As a result I am getting error “The extended property attribute combination is invalid.” As per the error the PropertyType might be wrong. So, I set different types as well but no luck.

    Managed API FindAppointments:
    CalendarView calendarView = new CalendarView ( System.DateTime.Now.AddDays ( -3 ), System.DateTime.Now.AddDays ( 2 ) );
    Mailbox mailbox = new Mailbox ( emailAddress );
    FolderId calendarFolder = new FolderId ( WellKnownFolderName.Calendar, mailbox );
    FindItemsResults<Appointment> findResults = service.FindAppointments ( calendarFolder, calendarView );

    //0x8259;// 0x8186; //0x8238; //0x001D;
    ExtendedPropertyDefinition prop = new ExtendedPropertyDefinition (DefaultExtendedPropertySet.Meeting, 0x8238, MapiPropertyType.String );

    service.LoadPropertiesForItems ( from Item item in findResults select item,
                                    new PropertySet ( BasePropertySet.IdOnly,
                                            AppointmentSchema.Resources,
                                            AppointmentSchema.Subject, prop ) );

                    foreach ( Appointment appointment in findResults.Items ) {
                        Console.WriteLine ( "Meeting: " + appointment.Subject );
    }


    In the above code I am not getting any error but I could not identify the field where I can find the attendees value.

    Please let me know your suggestion.

    As per my understanding by using this property, I will get the meeting attendees (including resources) display name string (delimited by a semicolon) and based on the display name I need to retrieve the email address by using Resolve. Please confirm.

    Thanks in advance for your support.

    Monday, November 28, 2011 2:26 PM
  • The property is in the Appointment Default property set (the documentation is wrong you can always confirm this by looking at the object in a Mapi editor like OutlookSpy of MFCMapi). Eg the following should work

                ExtendedPropertyDefinition prop = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x8238, MapiPropertyType.String);
                PropertySet psPropset = new PropertySet(BasePropertySet.IdOnly) { ItemSchema.Subject, prop };
                calendarView.PropertySet = psPropset;
                FindItemsResults<Appointment> findResults = service.FindAppointments(calendarFolder, calendarView);
                Hashtable cache = new Hashtable();
                foreach (Appointment appointment in findResults.Items)
                {
                    
                    Console.WriteLine("Meeting: " + appointment.Subject);
                    Object allAttendees = null;
                    if (appointment.TryGetProperty(prop, out allAttendees)) {
                        String[] attendees = ((String)allAttendees).Split(';');
                        foreach (String attendee in attendees) {
                            if (cache.Contains(attendee))
                            {
                                Console.WriteLine(cache[attendee]);
                            }
                            else
                            {
                                NameResolutionCollection ncCol = service.ResolveName(attendee, ResolveNameSearchLocation.DirectoryOnly, false);
                                foreach (NameResolution nc in ncCol)
                                {
                                    if (cache.Contains(attendee) == false)
                                    {
                                        Console.WriteLine(nc.Mailbox.Address);
                                        cache.Add(attendee, nc.Mailbox.Address);
                                    }
                                }
                            }
                        }
                    }
                }
    

    The resolve will only work for those users in the GAL if the appointments include external recipients then this method wont get those email addresses

    Cheers
    Glen

     


    Tuesday, November 29, 2011 3:29 AM
  • Thank you very much Glen for your support.

    I am able to get the meeting attendees. However, my main objective is to get resource information from the meeting. So, I have few questions

    (1)    Based on ResolveName response, can I identify that attendee is user or resource?

    (2)    In this approach we will be depend on attendee display name and according to me there can be more than one resource with the same display name in exchange. So, in this case how can I determine the correct attendee of the meeting?

    Appreciate your help to resolve this issue.

    Thanks.

    Wednesday, November 30, 2011 6:49 AM
  • 1. You can't do it directly but if you can specify that the Active Directory contact information is returned back with the Resolve request and just use one of those fields to define the resource as a resource (eg the assistant property is generally never used for a resource).

    2. Generally the DisplayName will always be unique eg things like ADUC and EMC wont allow you duplicate these what you might have is something like Meeting Room 1 and Meeting Room 11 which would return two resolution entries if resolved on the Meeting Room 1 but if you pull the Ad Contact info and compare the displayName to what you requested in Resolve name you should be able to confirm this.

    At the end of the day your dealing with the information that's available if that's not enough then you need to go back to the Source mailbox 

    Cheers
    Glen

    Thursday, December 1, 2011 12:30 AM
  • Thank you very much Glen for your support.
    Thursday, December 8, 2011 11:06 AM
  • Thanks Glen for your support.

    (1)    I am able to create multiple resources with the same display name in Exchange 2007. So, is there any setting in exchange to restrict it?

    (2)    Method “ResolveNames” returns multiple resource information so, is there any way to identify my meeting resource from the method response? For example there are two resources in Exchange with the same display name and I used resource 2 in my meeting but the method will retrieve two resources information. So, how can I identify my meeting resource?

    Please help me to resolve this issue.

    Friday, December 9, 2011 5:54 AM
  • 1. You can't stop duplicate displayName but generally most people would have a naming convention in place that admins should follow when creating mailbox  eg if your duplicating displaynames how are the users going to be able to tell the difference between the resources relying on them to look at another property will generally produce inconsistent results as it easy to mix up to similar objects it also affect discover-ability.

    2. As I mentioned in this instance you only have the displayname if you don't want to go back to the source mailbox you need to make sure that the displayname is unique. If you want to see for yourself what information you have to work with have a look at the appointment with a Mapi Editor like OutlookSpy or MFCMapi and you can see all the availible property information.

    Cheers
    Glen

    Monday, December 12, 2011 5:44 AM