(yagish)
12/26/2002 7:23:00 PM
Hi Everybody..
I am trying to read the passwords of the users on the server using
the LDAP, using the ADSI API.
I am able to access the user names and other properties using the
DirectoryEntry object and the Properties collection, but i also need
to access the passwords of the users.
I am not that experienced working with the LDAP, Please help me with
the code i am writing to do it. I also need to access the users and
their passwords, irrespective of the O.S. the server is using.
The code i have written is :-
======================================================================
static void Main(string[] args)
{
DirectoryEntry de = new
DirectoryEntry("LDAP://host/CN=Users,DC=i,DC=net");
Console.WriteLine("Name :"+de.Name);
foreach(DirectoryEntry o in de.Children)
{
Console.WriteLine("Name:"+ o.Name);
String str ="LDAP://host/"+o.Name+"?password?sub?userid="+o.Guid+",CN=Users,DC=i,DC=net";
Console.WriteLine(str);
DirectoryEntry depwd = new DirectoryEntry(str);
Console.WriteLine("Password:"+ depwd.Password);
}