diff --git a/Plugins/LdapPlugin/Ldap/Plugin.cs b/Plugins/LdapPlugin/Ldap/Plugin.cs index a1bc5ea7..67d7f944 100755 --- a/Plugins/LdapPlugin/Ldap/Plugin.cs +++ b/Plugins/LdapPlugin/Ldap/Plugin.cs @@ -358,13 +358,21 @@ public BooleanResult ChangePassword(SessionProperties properties, ChangePassword { if (entry.Method.HasFlag(Methods.ADPWD)) { + bool ADpwd = false; + string pwdmessage = ""; foreach (string server in hosts) { - if (Abstractions.WindowsApi.pInvokes.UserChangePassword(server, userInfo.Username, userInfo.oldPassword, userInfo.Password) == "") + pwdmessage = Abstractions.WindowsApi.pInvokes.UserChangePassword(server, userInfo.Username, userInfo.oldPassword, userInfo.Password); + if (pwdmessage == "") { + ADpwd = true; break; } } + if (!ADpwd) + { + return new BooleanResult { Success = false, Message = "Failed to change password.\n" + pwdmessage }; + } continue; }