ADSI - Change Password
Hi Experts,
I am using the following code to change the passsword of LDAP users.
DirectoryEntry oUserDE = new DirectoryEntry(Path);
DirectorySearcher oSearch = new DirectorySearcher(oUserDE);
oSearch.Filter = "(userPrincipalName=" + UserID + ")";
SearchResult oResult = oSearch.FindOne();
oUserDE = oResult.GetDirectoryEntry();
oUserDE.Invoke("ChangePassword", new object[]{OldPwd, NewPwd});
oUserDE.CommitChanges();
No error is thrown from these statements. However, the password in not correctly set in the sence, I cannot login using the new password.
Can anyone help me in this matter.
Thanks in Advance
Regards
Ganesh
__________________
Regards
Ganesh
http://ganeshprof.blogspot.com
Find your solution here...
|