locked
How to manage users in NT 4.0 Domain RRS feed

  • Question

  • User1439767045 posted
    I need to be able to add/remove some users to NT 4.0 Domain group (via ASP.Net site) Suppose I have account “User1” and group “Group1”. How to add/remove this user to this group? I have enough rights to do this on the server. I browsed Internet and found lot of information re Active Directory but nothing about NT 4.0 domain. Please help…
    Tuesday, July 13, 2004 3:40 AM

All replies

  • User-943578557 posted
    Check for ADSI and .NET in google. The System.DirectoryServices will handle everything you need. If you use an NT domain, or the newer AD system, the code is very similar.
    Tuesday, July 13, 2004 7:22 AM
  • User1439767045 posted
    What path I should use : "LDAP://MyDomain" or "WinNT://MyDomain". (I have PDC NT 4.0 domain). Can you give me a piece of code showing all users from MyGroup in MyDomain? I've tryied some code but nothing worked and really have no idea how to start...
    Thursday, July 15, 2004 3:13 AM
  • User541108374 posted
    Hi, did some quick googling and came up with this: article 1 !!! not .NET code !!! List of NT Userids. Excerpt from this snippet that looks promising to me: Add a reference in your project to System.DirectoryServices and do the following. using System.DirectoryServices; static void Main() { // In the LDAP string the DC='s represent Hostname Segments (ex. my.domain.com) replace with yours // Replace Domaincontroller with your domaincontrollers name string Enterprise = "LDAP://domaincontroller/CN=Users,DC=my,DC=domain,DC=com"; DirectoryEntry myDirectoryEntry = new DirectoryEntry( Enterprise ); foreach( DirectoryEntry de in myDirectoryEntry.Children ) { Console.WriteLine( de.Name ); } } Hope this helps you in the good direction Grz, Kris.
    Thursday, July 15, 2004 5:35 AM
  • User1439767045 posted
    I try this: Dim enTry As DirectoryEntry = New DirectoryEntry("LDAP://kolos/CN=Users,DC=weglokoks,DC=com,DC=pl") Dim direntr As DictionaryEntry For Each direntr In enTry.Children Console.WriteLine(direntr.ToString) Next , and receive "protocol error" info any idea?, host (PDC) name is "kolos", domain name is "weglokoks"
    Thursday, July 15, 2004 9:02 AM
  • User843746731 posted

    Digging up the past a bit here [;)]

    I've just found that my NT4 server doesn't support LDAP requests, again get that protocol error.

    So you can use:
    "WinNT://DomainName" as the directory entry string and it'll get a list of objects you can enumerate... However the WinNT doesn't support searching like LDAP so it's pretty basic.

    However I found you can use pretty much all the ADSI / WMI builtin functions by instead using something like:
    Dim objUser as object = GetObject("WinNT://DomainName/Username,user")
    objUser.FullName = "Mark Mailer"
    objUser.SetInfo

     

    Friday, January 19, 2007 4:28 AM