none
How can I retrieve all Room list for Exchange Server 2007 RRS feed

  • Question

  • I am trying to find all Meeting rooms for Exchange Server 2007 using c#. I found an easy way to do this by using EWS Managed API:

     http://msdn.microsoft.com/en-us/library/exchange/hh532566(v=exchg.80).aspx

    Unfortunately, GetRoomLists() does not work for Exchange Server 2007. I am hoping if some has worked or know how can I find meeting rooms on exchange server 2007, that would be a great help. I want to see all the meeting room available on Exchange server and then want to use their properties.

    Is there a way I can show all the existing room and then use its properties like Phone/Notes tab information?

    Any help or suggestion would be greatly appreciated.

    Thanks in advance !!

    Monday, November 19, 2012 5:53 PM

Answers

  • Hi Glen,

    Thank you so much!!

    It really helps.

    I have one issue though. I am trying to follow the same instruction for LPAD path but still its keep giving me error "The server is not operational". Do you think I would need to install some software on my server in order to run LPAD? I have tried not only with my exchange server but with google domain as well. I have tried to follow the enclosed link as well but no help:

    http://msdn.microsoft.com/en-us/library/bb384378.aspx

    I am working on Windows Server 2003 and trying to connect Exchange 2007.

    Cheers,

    Ratika




    • Edited by Rmittal Thursday, November 22, 2012 4:07 PM
    • Marked as answer by Rmittal Monday, November 26, 2012 4:05 PM
    Thursday, November 22, 2012 3:20 PM
  • >> I have tried not only with my exchange server but with google domain as well

    I still don't think you've really understood this is about accessing Active Directory it has nothing to do with either your Google domain or your Exchange Server. You need to find out what your Active Directory domain is. To make an LDAP query you need to be able to access port 389 on a domain controller are you inside or outside the firewall on the network your trying to access ?. You might want to try a tool like AdExplorer http://www.virtualcomputer.com/support/tutorials-ad-explorer to see if you can access AD properly outside of your code from the location your trying to run the code from. If your outside  and you only have access to the Exchange server then this wont work for. My best suggestion in that case would be to use a Group and then use EWS to expand that group.

    Cheers
    Glen

    • Marked as answer by Rmittal Monday, November 26, 2012 4:05 PM
    Friday, November 23, 2012 9:56 AM

All replies

  • RoomLists are an Exchange 2010 feature but you can more or less reproduce this feature in 2007. Eg if you just create a normal distribution list and add the Meeting Rooms as members in the EMC you can then use the ExpandGroup http://msdn.microsoft.com/en-us/library/exchange/ee343988%28v=exchg.80%29.aspx operation to get the Groups members (which should be the meeting rooms you added as members). Otherwise you can use LDAP via System.DirectoryServices to search for the Meeting Rooms in Active Directory eg http://gsexdev.blogspot.com.au/2007/04/webservice-to-find-room-and-equipment.html

    Cheers
    Glen

    Tuesday, November 20, 2012 5:22 AM
  • Hi Glen,

    Thank you so much for your reply.

    I really appreciate it!!

    I was working with LDAP but it keeps giving me error "The server is not operational". I thought may be I am using wrong credential. Therefore I tried with Google and it did not help me.

    Enclosed please find my code:-

    using (DirectoryEntry dir2 = new DirectoryEntry("LDAP://www.google.com/DC=www,DC=google,DC=com", null, null, AuthenticationTypes.Encryption))
                {
                    dir2.RefreshCache();
    
                    DirectorySearcher adSearch = new DirectorySearcher(dir2);
                    adSearch.Filter = "(&(objectClass=*)(msExchRecipientDisplayType=7))";
                    SearchResultCollection adResult = adSearch.FindAll();
    
                    foreach (SearchResult item in adResult)
                    {
    
                        ResultPropertyCollection property = item.Properties;
    
                        ResultPropertyValueCollection name = property["name"];
                        ResultPropertyValueCollection proxyAddresses = property["proxyAddresses"];
                        ResultPropertyValueCollection legacyExchangeDN = property["legacyExchangeDN"];
    
                        ..........
                }
    It gives me error on enclosed code :-
    dir2.RefreshCache();
    I am not sure, what I am doing wrong. I have tried with different LDAP values like :-

    using (DirectoryEntry dir2 = new DirectoryEntry("LDAP://ldap.google.com/DC=www,DC=google,DC=com", null, null, AuthenticationTypes.Encryption))

    using (DirectoryEntry dir2 = new DirectoryEntry("LDAP:///DC=www,DC=google,DC=com", null, null, AuthenticationTypes.Encryption))
     
    using (DirectoryEntry dir2 = new DirectoryEntry("LDAP://DC=www,DC=google,DC=com", null, null, AuthenticationTypes.Encryption))
     


    But nothing really helped me.

    Do you know what I am doing wrong?

    Enclosed please find the stack trace:

       at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
       at System.DirectoryServices.DirectoryEntry.Bind()
       at System.DirectoryServices.DirectoryEntry.RefreshCache()
       at Test_Exchange.Program.Main(String[] args) in C:\Inetpub\wwwroot\Test Exchange\Test Exchange\Program.cs:line 26
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

    Thanks!!





    • Edited by Rmittal Tuesday, November 20, 2012 3:35 PM
    Tuesday, November 20, 2012 3:05 PM
  • Are you pointing to a Domain Controller ? I would suggest you try to use RootDSE if you running it from a domain connect machine eg

    string roRootDSE = dsDirectorySearcher.SearchRoot.Path;
    DirectoryEntry deDirectoryEntry = new DirectoryEntry(roRootDSE);
    DirectorySearcher dsDirectorySearcher = new DirectorySearcher(deDirectoryEntry);

    Cheers
    Glen

    Wednesday, November 21, 2012 5:35 AM
  • Hi Glen,

    I am not on the same Domain whom I am trying to connect.

    And therefore, I guess I can not use RootDSE.

    In order to get connected to other domain I would need to define proper URL and credentials. Right?

    I have one more question though. In enclosed code what is 

    dsDirectorySearcher ?
    string roRootDSE = dsDirectorySearcher.SearchRoot.Path;

    I thought may be it is 

    DirectorySearcher's object

    But then what we would pass in DirectorySearcher() before DirectoryEntry.

    I am just wondering how the domain  information and its credential will gonna pull.

    I apologies for asking such stupid things.

    I am new to Exchange server and trying to retrieve room information from Exchange 2007.  After doing research, I get to know that for retrieving I would need to use LDAP. I am trying to use LDAP now, but I am still unable to get the information.

    I am not sure how can I get the information and therefore thought to start this thread. 

    Thanks in advance for all your suggestions and great help !!


    • Edited by Rmittal Wednesday, November 21, 2012 3:56 PM
    Wednesday, November 21, 2012 3:36 PM
  • The really import thing is that you must make your query against a Domain controller and that will be a different server then the Exchange server. Querying Active Directory via LDAP has nothing to do with Exchange your just querying AD I'd have a read through http://www.c-sharpcorner.com/UploadFile/ecabral/ADand.NET08242005065451AM/ADand.NET.aspx which has an explanation and step by step code to query AD. Once you have that work just plug in the filter for the meeting rooms

    Cheers
    Glen

    Thursday, November 22, 2012 5:28 AM
  • Hi Glen,

    Thank you so much!!

    It really helps.

    I have one issue though. I am trying to follow the same instruction for LPAD path but still its keep giving me error "The server is not operational". Do you think I would need to install some software on my server in order to run LPAD? I have tried not only with my exchange server but with google domain as well. I have tried to follow the enclosed link as well but no help:

    http://msdn.microsoft.com/en-us/library/bb384378.aspx

    I am working on Windows Server 2003 and trying to connect Exchange 2007.

    Cheers,

    Ratika




    • Edited by Rmittal Thursday, November 22, 2012 4:07 PM
    • Marked as answer by Rmittal Monday, November 26, 2012 4:05 PM
    Thursday, November 22, 2012 3:20 PM
  • >> I have tried not only with my exchange server but with google domain as well

    I still don't think you've really understood this is about accessing Active Directory it has nothing to do with either your Google domain or your Exchange Server. You need to find out what your Active Directory domain is. To make an LDAP query you need to be able to access port 389 on a domain controller are you inside or outside the firewall on the network your trying to access ?. You might want to try a tool like AdExplorer http://www.virtualcomputer.com/support/tutorials-ad-explorer to see if you can access AD properly outside of your code from the location your trying to run the code from. If your outside  and you only have access to the Exchange server then this wont work for. My best suggestion in that case would be to use a Group and then use EWS to expand that group.

    Cheers
    Glen

    • Marked as answer by Rmittal Monday, November 26, 2012 4:05 PM
    Friday, November 23, 2012 9:56 AM
  • Hi Glen,

    It worked really well. I was using the wrong AD name.

    Thank you so much for your great help!!

    I really appreciate it!!

    Cheers,

    Ratika

    Monday, November 26, 2012 4:04 PM