Click here to Skip to main content
15,915,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

Here i want to know how to Retrieve Passwords from Active Directory (from Domain)
i Retrieved Usernames but iam unable to get Passwords for the Perticular UserNames.So please if any Information please share with me.


Regards,

AnilKumar.D
Posted

1 solution

 
Share this answer
 
Comments
Anil Honey 206 14-Aug-13 6:14am    
But iam unable to get the Passwords from Active Directory

this is the code i used for getting usernames

using (var context = new PrincipalContext(ContextType.Domain, "empover.com"))
{
using (var searcher = new PrincipalSearcher(new UserPrincipal(context)))
{
foreach (var result in searcher.FindAll())
{
DirectoryEntry de = result.GetUnderlyingObject() as DirectoryEntry;

DropDownList1.Items.Add("" + de.Properties["samAccountName"].Value);

//DropDownList1.Items.Add("" + de.Properties[" base.Password"].Value);
//Console.WriteLine("First Name: " + de.Properties["givenName"].Value);
//Console.WriteLine("Last Name : " + de.Properties["sn"].Value);
//Console.WriteLine("SAM account name : " + de.Properties["samAccountName"].Value);
//Console.WriteLine("User principal name: " + de.Properties["userPrincipalName"].Value);
//Console.WriteLine();
}
}
}
ridoy 14-Aug-13 6:17am    
Do you check those links?This is impossible.Windows stores passwords using the NTLM hash,the passwords themselves are not stored at all.
Anil Honey 206 14-Aug-13 6:24am    
can we compare the passwords means if samAccountName and password which i enter Should match like this is possible.
ridoy 14-Aug-13 7:05am    
Yes.These will help you to do that..http://stackoverflow.com/questions/290548/validate-a-username-and-password-against-active-directory, http://stackoverflow.com/questions/400872/active-directory-check-username-password, http://stackoverflow.com/questions/3225168/how-can-you-test-if-an-ad-password-will-meet-configured-complexity-requirements

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900