My code is as shown below. I am trying to extract the logged on user's
email id. I get all properties except emailid.
Please can anybody help.
Thanks
Sumana
public void getemail()
{
DirectoryEntry entry = new DirectoryEntry("LDAP://xyz");
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(cn=" + Session["UserId"].ToString()+ ")";
search.SearchScope = SearchScope.Subtree;
foreach(SearchResult result in search.FindAll())
{
foreach(string propertyname in result.Properties.PropertyNames)
{
Trace.Warn(propertyname);
Trace.Warn(result.Properties[propertyname][0].ToString());
}
}
}