Trying to retrieve list of rooms using EWS Managed API but it returned empty collection

Hi,

I'm trying to retrieve list of rooms using EWS Managed API. Before I have tried the following code I make sure our Administrator put all the rooms in a list following  link https://technet.microsoft.com/en-us/library/ee633471%28v=exchg.141%29.aspx.

Here is the simple code I have used :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Exchange.WebServices.Data;
using System.Net;
using System.Security;

namespace ExchangeConsole1
{
    class Program
    {
        static void Main(string[] args)
        {
            ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
  
            service.Credentials = new NetworkCredential("username", "Password1", "domain");
            service.Url = new Uri("https://email.xxxx.com/ews/exchange.asmx");
            EmailMessage email = new EmailMessage(service);


            EmailAddressCollection listOfRoomList = service.GetRoomLists();
            // Display the individual rooms.
            foreach (EmailAddress address in listOfRoomList)
            {
                Console.WriteLine("Email Address: {0}", address.Address);
            }

        }
    }
}

service.GetRoomLists() results "Enumeration yielded no results". Could anybody help me please ?

Thanks

Sandipan



April 10th, 2015 10:26am

Enable tracing and see what the response from the server looks like. Also depending on your setup and how long ago your administrator created the list, it may take some time to replicate.

Free Windows Admin Tool Kit Click here and download it now
April 10th, 2015 10:43am

Enable tracing and see what the response from the server looks like. Also depending on your setup and how long ago your administrator created the list, it may take some time to replicate.

Administrator has done it one week ago. Here is the trace response I am getting

<Trace Tag="EwsResponse" Tid="9" Time="2015-04-10 15:36:37Z" Version="15.00.0847.030">
  <?xml version="1.0" encoding="utf-8"?>
  <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
      <h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="995" MinorBuildNumber="31" Version="V2_15" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <m:GetRoomListsResponse ResponseClass="Success" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
        <m:ResponseCode>NoError</m:ResponseCode>
        <m:RoomLists />
      </m:GetRoomListsResponse>
    </s:Body>
  </s:Envelope>
</Trace>

It's say no error.  Any help ?

Thanks

Sandipan

April 10th, 2015 11:44am

You might want to check that Exchange knows about these lists. From the Exchange management shell, do (or ask your admin to do):

Get-DistributionGroup -RecipientTypeDetails RoomList

Does any results come back? If so, something is wrong with your Exchange configuration causing EWS to not return the same results and you may need to contact support. If not, then the room lists were not created properly (most likely omitting the -RoomList parameter when running the New-DistributionGroup cmdlet).

  • Marked as answer by sandipanp 19 minutes ago
Free Windows Admin Tool Kit Click here and download it now
April 10th, 2015 3:58pm

You might want to check that Exchange knows about these lists. From the Exchange management shell, do (or ask your admin to do):

Get-DistributionGroup -RecipientTypeDetails RoomList

Does any results come back? If so, something is wrong with your Exchange configuration causing EWS to not return the same results and you may need to contact support. If not, then the room lists were not created properly (most likely omitting the -RoomList parameter when running the New-DistributionGroup cmdlet).

  • Marked as answer by sandipanp Saturday, April 11, 2015 7:06 AM
April 10th, 2015 7:56pm

You might want to check that Exchange knows about these lists. From the Exchange management shell, do (or ask your admin to do):

Get-DistributionGroup -RecipientTypeDetails RoomList

Does any results come back? If so, something is wrong with your Exchange configuration causing EWS to not return the same results and you may need to contact support. If not, then the room lists were not created properly (most likely omitting the -RoomList parameter when running the New-DistributionGroup cmdlet).

Our administrator made some changes according to your suggestion and I'm able to retrieve room lists and rooms in a particular list. Thank you very much for your assistance. I appreciate it.

Thanks

Sandipan

Free Windows Admin Tool Kit Click here and download it now
April 11th, 2015 3:08am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics