Skip to content

Instantly share code, notes, and snippets.

@cowlike
Last active October 2, 2015 03:28
Show Gist options
  • Save cowlike/2162743 to your computer and use it in GitHub Desktop.
Save cowlike/2162743 to your computer and use it in GitHub Desktop.
ldap read
foreach (SearchResult dnResult in rootSearcher.FindAll())
{
EmailAddresses.Add(dnResult.Properties["mail"].ToString());
}
foreach (SearchResult dnResult in rootSearcher.FindAll())
{
foreach (string dnName in dnResult.Properties.PropertyNames)
{
foreach (var dnEntry in dnResult.Properties[dnName])
{
if (dnName == "mail")
{
EmailAddresses.Add(dnEntry.ToString());
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment