Click here to Skip to main content
15,879,095 members
Articles / Programming Languages / C#
Alternative
Tip/Trick

Accessing Active Directory Objects via C# (Visual Studio)

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
22 Feb 2011CPOL 7.7K   3  
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)


Written By
Poland Poland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --