起初請原諒我的英文,這不是我的母語。更改Active Directory密碼
我正在開發一個管理Active Directory的Web平臺。我可以創建,刪除和編輯組,用戶,OU等。
當連接的用戶想要用平臺更改自己的密碼時,它會失敗。
它來自DirectoryEntry.Invoke
。
我用DirectoryServices.DirectoryEntry
:
directoryEntry.Invoke("SetPassword", password);
directoryEntry.Commit();
所以,我想System.DirectoryServices.AccountManagement:
PrincipalContext ctx = new PrincipalContext(ContextType.Machine);
UserPrincipal user = UserPrincipal.FindByIdentity(ctx, Username);
user.SetPassword(password_);
user.Save();
不同的方式,同樣的問題。
只有當用戶試圖編輯自己的密碼時,它纔會失敗。
任何幫助將不勝感激。
可能重複[如何programaticly變更Active Directory密碼(http://stackoverflow.com/questions/1066131/how-to-programaticly-change-active-directory-password) – JMax