The stored procedure specified by the system setting PreUpdatePasswordProcedure is called when a user changes their password using the built in Change password menu item.
It is not called when an administrator changes the user's password, or if another procedure calls SoftadminApi.User_UpdatePassword directly.
If you need to enforce a password policy, use PasswordPolicyFulfillsPolicyProcedure instead.
CREATE PROCEDURE CustomPreUpdatePasswordProcedure
@UserId int,
@NewPassword nvarchar(255),
@LanguageId int
AS
BEGIN
DECLARE @HashedPassword varbinary(4000) = SoftadminUtil.Password_Hash(@NewPassword, DEFAULT);
INSERT INTO PasswordLog (UserId, HashedPassword, InsertDatetime)
VALUES (@UserId, @HashedPassword, SYSDATETIMEOFFSET());
END;