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

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
 
T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top