Active Directory
-
I want to retrieve the usernames and passwords of all the users present on the active directory of a server. How will I be able to do that? Any sugestion is welcomed..........
-
I want to retrieve the usernames and passwords of all the users present on the active directory of a server. How will I be able to do that? Any sugestion is welcomed..........
You can retrieve the usernames but you cannot retrieve passwords, for obvious security reasons and the user-password attribute is write-only.
using System.DirectoryServices;
DirectoryEntry entry = new DirectoryEntry("LDAP://PathToStartOfSearch");
DirectorySearcher mySearcher = new DirectorySearcher(entry);
mySearcher.Filter = ("(&(objectClass=user))");
foreach(SearchResult result in mySearcher.FindAll())
{
Console.WriteLine( result.GetDirectoryEntry().Path );
}RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome