Active Directory Ændring af password
Jeg har denne metode til at ændre et password men der kommer en exception i linien med "Invoke"Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))
Er der nogen der kender den fejl?
public void AlterPassword(string username,string oldPassword, string newPassword){
entry = new DirectoryEntry("LDAP://DomTemp.local", username, oldPassword);
entry.AuthenticationType = AuthenticationTypes.Secure;
DirectorySearcher deSearch = new DirectorySearcher(entry);
deSearch.Filter = "(&(objectClass=user) (cn=" + username + "))";
SearchResultCollection results = deSearch.FindAll();
entry.Invoke("ChangePassword", new object[] { oldPassword, newPassword });