List user : User Add : Directory Services C# Examples


C# Examples » Directory Services » User Add »

 

List user









    
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  );
                }
            }
      }      
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Directory Services
» User Add