EWS not returning GetRoomList - Exchange 2016 On-Prem

32 Views Asked by At

I've installed a Exchange Server 2016 , setup admin and some users and created some rooms. All account tested via OWA is able to detect Roomlist. What I'm trying now is to get a list of room via Exchange Server but facing some issue when i ran this code.

static void Main(string[] args)
        {
            ExchangeService service = new ExchangeService();
            // Set the credentials for the on-premises server.
            service.Credentials = new WebCredentials("username","password");
            
            service.AutodiscoverUrl("[email protected]");

            service.Url = new Uri("https://mail.domain.com/EWS/Exchange.asmx");

            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);
            }
            Console.ReadLine();
        }

Is there any setting or account setting that I miss ?

I've tried changing account credentials , domain and postman request still its not returning any roomlist. I'm expecting this clear cut code will return all the list of rooms that has been created.

0

There are 0 best solutions below