0
我有一個交換賬戶,可以訪問我們所有房間的電子郵件賬戶。
我需要使用此「管理帳戶」獲取每個房間的所有計劃約會。通過一個賬戶從不同房間獲取預約
開始時我爲每個帳戶設置了登錄名。
我將所需的信息存儲在對象中,然後使用以下代碼獲取所有需要的數據。
string roomName = rooms[i].RoomName;
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
service.Timeout = 5000;
service.Credentials = new NetworkCredential(rooms[i].AccountName + "@company.com", rooms[i].AccountPassword);
service.AutodiscoverUrl(rooms[i].AccountName + "@company.com");
DateTime startDate = DateTime.Now;
DateTime endDate = startDate.AddDays(7);
const int NUM_APPTS = 280;
Console.WriteLine("Start binding calendar objects");
//init calender folder object
CalendarFolder calendar = CalendarFolder.Bind(service, WellKnownFolderName.Calendar, new PropertySet());
Console.WriteLine("Start setting start and end time and number of appointments to retrieve");
//set start and end time and number of appointments to retrieve.
CalendarView cView = new CalendarView(startDate, endDate, NUM_APPTS);
Console.WriteLine("limit the properties");
//limit the properties returned to subject(name of the person who booked the room, name of the room, start and end time(datetime) of the meeting
cView.PropertySet = new PropertySet(AppointmentSchema.Organizer, AppointmentSchema.Start, AppointmentSchema.End, AppointmentSchema.Subject);
//retrieve Collection of appointments by using the calendar view
FindItemsResults<Appointment> appointments = calendar.FindAppointments(cView);
對管理員帳戶使用此代碼只會返回任何內容。
我試圖讓所有房間此帳戶用下面的代碼
System.Collections.ObjectModel.Collection<EmailAddress> myRoomAddresses = service.GetRooms("[email protected]");
但這僅返回ServiceResponseException:沒有發現。
有沒有人知道一種方式來獲得所有房間+約會,只使用管理帳戶?