Hi Kristin,
Thanks for your answer but I'm trying to work with classes of System.DirectoryServices.AccountManagement.
I did some research, most of scenarios, we often use DirectoryEntry to set Password. Could you tell me why you insist on using classes under System.DirectoryServices.AccountManagement ?
public void ResetPassword(string userDn, string password)
{
DirectoryEntry uEntry = new DirectoryEntry(userDn);
uEntry.Invoke("SetPassword", new object[] { password });
uEntry.Properties["LockOutTime"].Value = 0; //unlock account
uEntry.Close();
}
Best regards&&kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.
No comments:
Post a Comment