Click here to Skip to main content
13,150,163 members (78,366 online)
Click here to Skip to main content
Add your own
alternative version

Stats

4.7K views
3 bookmarked
Posted 22 Feb 2011

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

This member doesn't quite have enough reputation to be able to display their biography and homepage.

You may also be interested in...

Comments and Discussions

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