Search code examples
ldap

Getting Middle Initial from LDAP


I am trying to get the middle Initial of a user from LDAP. I don't know what pass into the DirectorySearcher. Here is what I have so far

search.PropertiesToLoad.Add("memberOf");
search.PropertiesToLoad.Add("distinguishedname");
search.PropertiesToLoad.Add("name");
search.PropertiesToLoad.Add("usnchanged");
search.PropertiesToLoad.Add("objectguid");
search.PropertiesToLoad.Add("givenname");
search.PropertiesToLoad.Add("sn");
search.PropertiesToLoad.Add("mail");
search.PropertiesToLoad.Add("samaccountname");

Solution

  • There is an "initials" attribute in user object. Is this what u want?

    http://msdn.microsoft.com/en-us/library/ms676202%28v=vs.85%29.aspx