List user : User Add « Directory Services « C# / CSharp Tutorial






using System;
using System.Data;
using System.DirectoryServices;

public class MainClass{

   public static void Main() {
      DirectoryEntry directoryEntry1 = new DirectoryEntry();
      directoryEntry1.AuthenticationType = AuthenticationTypes.Secure;
      directoryEntry1.Path = "WinNT://MSHOME/alien";

      foreach( DirectoryEntry entry in directoryEntry1.Children ) {
        if ( entry.SchemaClassName == "User" ) {
          //Console.WriteLine( entry.Properties[ "Name" ].Value );
          Console.WriteLine( entry.Name );
        }
      }
   }   
}








34.10.User Add
34.10.1.Add user
34.10.2.Adding new user To The Directory
34.10.3.List user