locked
unable to retrieve All contacts from AD RRS feed

  • Question

  • Hi,

    I need to get All Contacts from a particular OU say "Custom", and need to update thier email address.

    To get all the contact I am using the following command in VS 2010 , but getting unspecified COM Exception .

    DirectoryEntry de = new DirectoryEntry(ldap, user, pass);

                    DirectorySearcher deSearch = new DirectorySearcher();

     

                    deSearch.SearchRoot = de;              

                   deSearch.Filter = "(&(objectCategory=person)(objectClass=Contact))";               

                    deSearch.SearchScope = SearchScope.Subtree;

                    SearchResultCollection results = deSearch.FindAll();

                    return results;

     

    Please Correct me if I am wrong or is it a bug with VS2010

     


    Azra
    Friday, April 8, 2011 10:22 AM

Answers

  • my mistake , LDAP Address was LDAP\\ IP Address of AD , I was trying without "LDAP\\"
    Azra
    • Marked as answer by Azra Ansari Friday, April 8, 2011 10:43 AM
    Friday, April 8, 2011 10:43 AM

All replies