问题
My exchange services works. I can see all rooms by Outlook and Can see all rooms through Powershell. But with this snippet I cannot retrieve any room
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
service.UseDefaultCredentials = true;
service.Url = new Uri("https://my server/ews/exchange.asmx");
service.AutodiscoverUrl("username@myserver.com", RedirectionCallback);
EmailAddressCollection myRoomLists = service.GetRoomLists();
// Display the room lists.
foreach (EmailAddress address in myRoomLists)
{
Console.WriteLine("Email Address: {0} Mailbox Type: {1}", address.Address, address.MailboxType);
}
The list is empty!
回答1:
It sounds like your Exchange administrator has not configured any room lists. EWS depends on the presence of room lists in the GAL to work. See https://technet.microsoft.com/en-us/library/jj215781(v=exchg.150).aspx for details.
回答2:
See here for more info. You need to iterate through the room lists within the collection you got from GetRoomLists(), and then iterate through the conference rooms in each room list using service.GetRooms(myRoomList).
来源:https://stackoverflow.com/questions/31006063/cannot-retrieve-any-room-list-from-exchg-2013-with-c-sharp