I have problem with c# script who change user AD password, when try change password, they throw exception
A constraint violation occurred. (Exception from HRESULT: 0x8007202F)
Code
DirectoryEntry entry = new DirectoryEntry("LDAP://domain.com", strLoginName, oldpassword.Text.ToString(), AuthenticationTypes.Secure);
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(SAMAccountName=" + strLoginName + ")";
search.SearchScope = SearchScope.Subtree;
search.CacheResults = false;
SearchResultCollection results = search.FindAll();
foreach (SearchResult result in results)
entry = result.GetDirectoryEntry();
entry.Invoke("ChangePassword", new object[] { oldpassword.Text.ToString(), newpassword.Text.ToString() });
entry.CommitChanges();
Which could be a problem?