none
Query Exchange 5.5 users or Groups Problem RRS feed

  • Question

  • Hi All,
     
    I'm trying to query distribution lists on Exchange 5.5 in C#.

    I have an experience to work to query Users,DLs in AD Windows 2003,but the same code when i ran it against Exchange 5.5 on Windows 2000 no enteries are returned.


    here is my code :

    string strRcptContainer = LDAP://MYSERVERIP;

    //Check to see if the dl is already present

    DirectoryEntry deContainer = new DirectoryEntry(strRcptContainer);

    deContainer.Username = txtUsername.Text;

    deContainer.Password = txtPassword.Text;

    string strFilter = "(objectClass=group)";

    DirectorySearcher dsSearch = new DirectorySearcher(deContainer,strFilter );

    dsSearch.SearchScope = SearchScope.Subtree;

    dsSearch.SizeLimit = 20000;

    dsSearch.PageSize = 1000;

    string[] propToLoadList ={ "name", "ou" };

    dsSearch.PropertiesToLoad.AddRange(propToLoadList);

    SearchResultCollection searchCol = dsSearch.FindAll();

     searchCol.Count  is always Zero ? can any one help to how to fix that ?

    The Same Code is working Perfectly with AD Windows 2003,and since Exchange 5.5 has its own Directory Service,that's why i have to query our Exchange Server to get users or groups.


    Any Help ? ASAP ?


    Moustafa Arafa
    • Moved by jack 321 Wednesday, September 10, 2008 7:21 AM exchange server issue (Moved from Visual C# General to Using the Exchange Server Protocols)
    Sunday, September 7, 2008 8:21 AM

Answers

  • Thank you for your interest in Exchange development and for contacting us.

     

    There is a very helpful community of Exchange developers on the Exchange Development forum that may be able to assist you with your solution. I suggest you post your question to the Exchange Development forum found here:

    http://forums.microsoft.com/TechNet/ShowForum.aspx?ForumID=838&SiteID=17.

    You should also search the forum in case someone has already asked a similar question.

     

    When posting to this forum, we suggest you provide background information about your environment and proposed solution such as:

    - Exchange Server version.

    - Programming language used to develop your solution.

    - Description of your Exchange topology.

     

    Providing this background information will better enable other developers to help you with your solution. Also feel free to answer other posts on the forum.

     

    In addition to the Exchange Development forum, you will also want to review the Exchange Developer Center

    (http://msdn2.microsoft.com/en-us/exchange/default.aspx) and the Exchange Server documentation

    (http://msdn2.microsoft.com/en-us/library/bb418718.aspx.)

     

    Wednesday, September 10, 2008 4:52 PM
    Moderator