none
Problem regarding booking windows for a mailbox room in Exhange RRS feed

  • Question

  • Hi,

    I am writing an application for making bookings in calender rooms. In my application a user enters a spefied room and time for a meating and meta data for that booking. Theese data will then be booked in outlook server 2010 in the given room.

    My question is:

    A mailbox of type room has a booking window - default is the booking window 180 days. I want to retrieve from Exchange server 2010 the configured booking window. Unfornately I cannot find a way to do that. It must be done with EWS and in C# .NET 3.5.

    Can someone answer my question!

    Best regards


    Mr Big Spender

    Wednesday, May 9, 2012 8:32 PM

All replies

  • >> A mailbox of type room has a booking window - default is the booking window 180 days. I want to retrieve from Exchange server 2010 the configured booking window

    By booking windows do you mean you just want to get the Calendar Appointments in that period is so just query the calendar for the Time period you want ? I'd suggest you use the EWS Managed API then you can do something like

                CalendarView calendarView = new CalendarView(DateTime.Today, DateTime.Today.AddDays(180));
                               
                PropertySet psPropertySet = new PropertySet(BasePropertySetFirstClassProperties);
                calendarView.PropertySet = psPropertySet;
    
                FindItemsResults<Appointment> findResults = service.FindAppointments(WellKnownFolderName.Calendar, calendarView);
                
                foreach (Appointment item in findResults.Items)
                {
                        Console.Write((DateTime)item.Start);
                        Console.Write((DateTime)item.End);
                        Console.Write(item.Subject);
                        Console.Write(item.Id.ToString());
                        Console.Write(item.Location);
                }

    You could also use an availability query via GetUserAvailability  eg http://msdn.microsoft.com/en-us/library/aa564001(v=exchg.140).aspx but there are limitations around the time period you can use which is 42 days by default

    Cheers
    Glen

    Thursday, May 10, 2012 5:50 AM
  • Hi,

    In Exchange Management Console I can expand the Recepient Configuration. Under Mailbox I double click on a room mailbox. Then I click on the Resource Policy to see the booking window. In my test environment the booking window is 180 days for all rooms. This is the default value as I understand. So my question is how can I with EWS retreive that value? We must retrieve that value in our application to verify if an appointment can be done in that room. We don't wan't to use Managed API.

    Hope you understand!

    Best regards


    Mr Big Spender

    Thursday, May 10, 2012 9:36 AM
  • Okay you can get that value from the Calendar config FAI item in the calendar if its been set to a value other then default. Eg the default is 180 and no value is therefore set in the Calendar Config Item. If someone changes the default using something like Set-CalendarProcessing RoomMailboxBlah -BookingWindowInDays 181 you can the retrieve that value using

                FolderId cfCalendarFolder = new FolderId(WellKnownFolderName.Calendar, "roomMailboxBlah@domain.com");
                UserConfiguration CalendarConfig = UserConfiguration.Bind(service, "Calendar", cfCalendarFolder, UserConfigurationProperties.All);
                if (CalendarConfig.Dictionary.ContainsKey("BookingWindowInDays"))
                {
                    Console.WriteLine(CalendarConfig.Dictionary["BookingWindowInDays"].ToString());
                }

    Cheers
    Glen
    Friday, May 11, 2012 4:36 AM