Cannot retrieve any room list from Exchg 2013 with

2019-08-19 03:50发布

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!

2条回答
Anthone
2楼-- · 2019-08-19 04:17

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.

查看更多
何必那么认真
3楼-- · 2019-08-19 04:31

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).

查看更多
登录 后发表回答