diff --git a/python/samba/samdb.py b/python/samba/samdb.py index d1048a74e14..7f52a5e56f8 100644 --- a/python/samba/samdb.py +++ b/python/samba/samdb.py @@ -459,7 +459,9 @@ member: %s # Sets the password for it if setpassword: - self.setpassword("(samAccountName=%s)" % ldb.binary_encode(username), password, + self.setpassword(("(distinguishedName=%s)" % + ldb.binary_encode(user_dn)), + password, force_password_change_at_next_login_req) except: self.transaction_cancel()