Reading users and user groups

  • Thread starter Thread starter Bjorn Kristensen
  • Start date Start date
B

Bjorn Kristensen

Hi.

I'm trying to read all the users and user groups from the NT domain I'm
connected to.
I cnat't se how this should be done. Can anyone help me.

I'm basically trying to link my users to the domain user's! I'll keep track
of my applications
user rigts but with the NT Domain users..

Thanks

Bjorn.
 
Use the DirectoryServices namespace with the WinNT provider for NT4.0
domain, and LDAP for Win2K domain with Active Directory.

DirectoryEntry objDomain = new DirectoryEntry("WinNT://domain")
foreach(DirectoryEntry objChild in objDomain.Children) {
if(objChild.SchemaClassName == "user") {
// This is a user
}
}

Or something like that for NT 4.0 (not tested or compiled). For Win2K use
the LDAP://rootDSE to get the name of the domain naming context and use the
DirectorySearcher class to find all users.


Arild
 

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

Back
Top