获取所有房间的预约

时间:2014-12-01 22:44:29

标签: exchange-server exchangewebservices

目前,我可以获得一个房间的所有约会,但我有很多房间,如果我想要显示所有约会,表现非常糟糕,所以我想询问是否有方法获得多个房间的所有约会时间?

2 个答案:

答案 0 :(得分:0)

没有可行的操作。但是,如果您请求CalendarDetails,请参阅http://msdn.microsoft.com/en-us/library/office/hh532567%28v=exchg.80%29.aspx,您可以使用GetUserAvailbility操作,该操作将为您提供FreeBusy状态以及Calendar属性Start,End,Location,Subject的子集。此操作通常在42天内有时间窗口,并且每个请求最多只能检索100个邮箱。

干杯 格伦

答案 1 :(得分:0)

https://msdn.microsoft.com/en-us/library/office/dn495614(v=exchg.150).aspx

// Initialize values for the start and end times, and the number of appointments to retrieve.
        DateTime startDate = DateTime.Now;
        DateTime endDate = startDate.AddDays(30);
        const int NUM_APPTS = 5;

        // Initialize the calendar folder object with only the folder ID. 
        CalendarFolder calendar = CalendarFolder.Bind(service, WellKnownFolderName.Calendar, new PropertySet());

        // Set the start and end time and number of appointments to retrieve.
        CalendarView cView = new CalendarView(startDate, endDate, NUM_APPTS);

        // Limit the properties returned to the appointment's subject, start time, and end time.
        cView.PropertySet = new PropertySet(AppointmentSchema.Subject, AppointmentSchema.Start, AppointmentSchema.End);

        // Retrieve a collection of appointments by using the calendar view.
        FindItemsResults<Appointment> appointments = calendar.FindAppointments(cView);

        Console.WriteLine("\nThe first " + NUM_APPTS + " appointments on your calendar from " + startDate.Date.ToShortDateString() + 
                          " to " + endDate.Date.ToShortDateString() + " are: \n");

        foreach (Appointment a in appointments)
        {
            Console.Write("Subject: " + a.Subject.ToString() + " ");
            Console.Write("Start: " + a.Start.ToString() + " ");
            Console.Write("End: " + a.End.ToString());
            Console.WriteLine();
        }