Do I need active directory or can I query EWS? RRS feed

  • General discussion

  • Hi,

    We are running an older version of the exchange web service (< 2010) and I came across this article (, which led me to believe that it is not possible to use EWS to get a list of rooms and that I would have to use active directory instead.  Is this true?  We are using Java to generate the web service client, and upon doing so, there was no request or response elements created related to rooms.

    The message element that the WSDL references is <xs:import namespace="" schemaLocation="messages.xsd"/>.

    Thanks for any help, - Dave

    Thursday, February 17, 2011 4:43 PM

All replies

  • Dave, you can write the client for EWS in Java.  You first need to place all your rooms in the list on Exchange Server, then you can query the Exchange Servers list to get all the rooms.
    Saturday, February 19, 2011 9:41 PM
  • Yes you should use Active Directory the operations to get the RoomLists where added in Exchange 2010 and not available on 2007 a work around you can try is using a distribution list and then use expanddl to get the Room SMTP Addresses from the DL.


    Monday, February 21, 2011 2:46 AM
  • Hi Glen,

    In as far as I cannot use EWS 2007 to access the room list, what operations do I need to use with active directory to get the distribution list that I would subsequently use your "ExpandDL" logic on?

    Also, what you provided looks like a web service method, so is this what I would use with EWS after I have conducted the operations above? - Dave

    Tuesday, February 22, 2011 5:01 PM
  • Hi Dave,


    Here is the code to the utility class which I have created and here is the usage of that class. Hope it will help you.





    Tuesday, February 22, 2011 9:30 PM
  • If you want to use ExpandDL you just feed it in the SMTPAddress of the MailEnabled Group your expanding and what you would get back is all the SMTPAddress of the members of the group which if your going to use them in any other way in EWS you will need. I only mentioned expanddl as a workaround where you couldn't query AD if you can query AD then i would just use a query similar to what i did in my blog (if your using JAVA use what ever method you have available to query AD) or you could also use that Webservice as it is basically all it does is returns the SMTPAddress of any resource mailboxes it finds in Active Directory. 


    Wednesday, February 23, 2011 2:32 AM
  • Falak, Thanks for your code, but since I'm using the 2007 version of EWS and not the 2010 version, I can't take advantage of the GetRoomsResponseType and similar calls since those don't seem to be supported by the older version.

    Glen, You're blog rocks, and that is what led me down the ad path.  But above, when you say, "or you could also use that Webservice as it is basically all it does is returns the SMTPAddress of any resource mailboxes it finds," what method am I using to query all mailboxes with mailbox type of 7 (per your blog, you use "7" as the room type).

    Thanks, - Dave

    Friday, February 25, 2011 5:03 PM
  • In that particular Web service you would call FindRooms() which basically does the AD query on your behalf the actually code is pretty simple it just uses  system.directoryservices and does the LDAP query.



    Tuesday, March 1, 2011 2:34 AM