Remco,
In your Custom Command, the %unicodePwd% value reference will not be resolved. It is resolved only in Business Rules triggered before/after creating a user, resetting a password for a user or updating a user. In a Custom Command, it won't be resolved.
To workaround this, if you want to use a Custom Command, you can, for example, reset the password and send an email notification with the help of a PowerShell script. To add such a script to your Custom Command, you need to add the Run a program or PowerShell script action to your Custom Command and paste the necessary script in the Script field.
Here's an example of a script that resets a password for a user and emails it:
$password = "%adm-RandomString,7%" # TODO: modify me
$to = "recipient@domain.com" # TODO: modify me
$subject = "Password Reset for %fullname%" # TODO: modify me
$messageText = @"
Password has been reset for %fullname%.
New password: $password
Username: %username%
Please do not reply to this e-mail, it has been sent to you for notification purposes only.
"@ # TODO: modify me
$Context.TargetObject.SetPassword($password)
$Context.SendMail($to, $subject, $messageText, $NULL)
Modify the following in the script to match your requirements:
- $password - template for password generation,
- $to - recipient of the email notification,
- $subject - subject of the email notification,
- $messageText - notification message text.
As for your Business Rule, we didn't receive any screenshots of it. Can you resend?