Click here to Skip to main content
Click here to Skip to main content
Alternative Tip
Go to top

Accessing Active Directory Objects via C# (Visual Studio)

, 22 Feb 2011
Rate this:
Please Sign up or sign in to vote.
Hi,How to list all users in ListBox include cn, mobile, mail?private void Form1_Load(object sender, EventArgs e){ DirectoryEntry dir = new DirectoryEntry("LDAP://ou=o,DC=xyz,DC=de"); DirectorySearcher search = new DirectorySearcher(dir); search.Filter =...
Hi,
 
How to list all users in ListBox include cn, mobile, mail?
 
private void Form1_Load(object sender, EventArgs e)
{
    DirectoryEntry dir = new DirectoryEntry("LDAP://ou=o,DC=xyz,DC=de");
    DirectorySearcher search = new DirectorySearcher(dir);
    search.Filter = "(&(objectClass=user))"; // (mobile=+44*))";
    search.SearchScope = SearchScope.Subtree;
    SearchResultCollection searchresult = search.FindAll();
    if (searchresult != null)
{
    ???
}
 
Regards

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

No Biography provided

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 23 Feb 2011
Article Copyright 2011 by Member 3568076
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid