We use this code to query an ADAM instance.
DirectoryEntry adRoot = new DirectoryEntry(ConfigurationManager.AppSettings["LdapConnectionString"].ToString());
DirectorySearcher adSearch = new DirectorySearcher(adRoot);
adSearch.Filter = "(&(objectClass=user)(objectCategory=person))";
SearchResultCollection searchResults = adSearch.FindAll();
return searchResults;
This is in a tag in App.config:
add key="LdapConnectionString" value="LDAP://servername:portnumber/dc=domainname"
We use the code to print out all the property names that we are retrieving from an ADAM instance.
DirectoryEntry entry = searchResults[0].GetDirectoryEntry();
foreach (string property in entry.Properties.PropertyNames)
{
Console.WriteLine(property);
}
PropertiesToLoad is the empty StringCollection, PropertyNamesOnly is false.
We aren't retrieving proxyAddresses, street, zipCode, and many other attributes we need for our program.
I found here that:
If you do not specify a list of attributes, the search returns values for all attributes permitted by the access control set in the directory.
So, my question...where is this access control set and how would we modify it so we could have access to those attributes?