Cannot retrieve any room list from Exchg 2013 with c#

筅森魡賤 提交于 2019-12-12 05:09:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!