Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

[E2010] [EWSMA] I do not see all Room appointments

$
0
0

Hi all,

i have a problem when i try to see the appointments of a room.
I created a service with the EWS Managed API using my own credentials (user@mydomain.com). Then i created a method to return a list of  custom objects named RoomMeeting by passing my service and the smtp address of the room mailbox (myroom@mydomain.com).

Here is the method :

       public static ObservableCollection<RoomMeeting> FindAppointmentsForTodayTomorrow(ExchangeService service, string roomAddress)
        {
            ObservableCollection<RoomMeeting> meetings = new ObservableCollection<RoomMeeting>();
            CalendarView calendarView = new CalendarView(DateTime.Now, DateTime.Today + TimeSpan.FromDays(1));
            calendarView.PropertySet = new PropertySet();
            calendarView.PropertySet.Add(AppointmentSchema.Start);
            calendarView.PropertySet.Add(AppointmentSchema.End);
            calendarView.PropertySet.Add(AppointmentSchema.Organizer);
            calendarView.PropertySet.Add(AppointmentSchema.Subject);
            calendarView.PropertySet.Add(AppointmentSchema.Duration);
            calendarView.PropertySet.Add(AppointmentSchema.Location);
            calendarView.MaxItemsReturned = 10;
            Mailbox mailbox = new Mailbox(roomAddress);


            FolderId calendarFolder = new FolderId(WellKnownFolderName.Calendar, mailbox);


           // var result = service.FindAppointments(WellKnownFolderName.Calendar, calendarView);


            FindItemsResults<Item> response = service.FindItems(WellKnownFolderName.Calendar, calendarView);


            for (int i = 0; i < response.Items.Count; i++)
            {
                if (response.Items[i] is Appointment)
                {
                    Appointment appointment = (Appointment)response.Items[i];


                    RoomMeeting meeting = new RoomMeeting();
                    meeting.Duration = appointment.Duration;
                    meeting.Start = appointment.Start;
                    meeting.End = appointment.End;
                    meeting.Subject = appointment.Subject;
                    meeting.Owner = appointment.Organizer.Name;


                    meetings.Add(meeting);
                }
            }


            return meetings;
        }

The problem is that i only get the appointments made by user@mydomain.com and not all the appointments relative to myroom@domain.com.
How can i do that ?

Thanks for the help 



Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>