List users and groups from ActiveDirectory in ASP.NET page?

  • Thread starter Thread starter TK
  • Start date Start date
T

TK

How can I show a list of OS users and groups in an ASP.NET page?
Is there MSDN or SDK articles?

please help.
TK
 
Thank you Martin.
Today I've learned about System.DirectoryServices as you pointed, and I
succeeded to get a list of AD objects in //domain/Users. My current code is
as following.

using System;
using System.Security;
using System.DirectoryServices;

namespace users
{
public class listUsers
{
public static int Main()
{
DirectoryEntry entries =
new DirectoryEntry("LDAP://CN=Users,DC=mydom,DC=local");

foreach(DirectoryEntry ent in entries.Children)
{
Console.WriteLine("{0} {1}", ent.Name, ent.Path);
}
return 0;
}
}
}

Above program show me a complete list of users and groups which are exist in
//mydom.local/Users. But I still haven't understood clearly. I want to
distinguish group or user object from the entries.Children list.
How can I do it? What the things I should learn about?

TK
 
Back
Top