Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I want to retrieving the list of all rooms within an organization. The basic purpose is to find all the rooms in an organization and find their respective appointments within the specific period of time. I can see the All Rooms (using the Outlook GUI)

But how can I get all the rooms using the Exchanged Service Managed API.

I use the following methods EmailAddressCollection roomLists = this.service.GetRoomLists();
but it returns empty, but I can see all rooms in outlook.

Please help me?
Posted
Updated 26-Sep-12 2:45am
v3

1 solution

C#
private static SearchResultCollection SearchDirectory(string filter)
{
    DirectorySearcher search = new DirectorySearcher(filter);
    return search.FindAll();
}


C#
private SearchResultCollection SearchRooms()
{
    return SearchDirectory("(&(objectClass=*)(msExchRecipientDisplayType=7))");
}



******This method returns RoomList*******
C#
public IEnumerable<string> GetRooms()
{
    IList<string> rooms = new List<string>();
    SearchResultCollection roomsCollection = SearchRooms();

    foreach (SearchResult result in roomsCollection)
    {
        DirectoryEntry entry = result.GetDirectoryEntry();
        rooms.Add(entry.Properties["mail"].Value.ToString().Trim());
    }
    return rooms;
}</string></string></string>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900