Cannot retrieve any room list from Exchg 2013 with c#

857 views Asked by At

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("[email protected]", 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

There are 2 answers

0
Venkat Ayyadevara - MSFT On

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

0
Jason Johnston On

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.