0 votes

To include a password in an e-mail when creating a user I use %unicodePwd% which works. But when I use Action "Reset User password" using template %adm-RandomString,7% I'm not able to include the password in an e-mail (not with %unicodePwd% or %userPassword%). How can I achieve this?

Thnx Remco

by (780 points)
0

Hello Remco,

As far as we understand, you used a Business Rule for this purpose. Can you send a screenshot of the actions/conditions in the Business Rule to our support e-mail (support[at]adaxes.com) or post it here?

1 Answer

0 votes
by (216k points)

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?

0

Remco,

As for your Business Rule, the reason why this doesn't work is in how Adaxes resolves value references. Whenever an operation triggers Business Rules, Adaxes collects all value references in all the Business Rules and resolves them. Only after that, Adaxes starts performing the actions in the Business Rules.

Since the password is reset and the email is sent within the same Business Rule, the %unicodePwd% value reference gets resolved before you set the new password with the Business Rule, that is, before executing the Business Rule. Since the Business Rule wasn't triggered by resetting a password, the %unicodePwd% gets resolved into an empty string.

To resolve the issue, you have two options:

  1. You can reset the password and send the email message within the same Business Rule. For this purpose, you can use the Run a program or PowerShell script action, the same as suggested for your Custom Command in our Mail with password visible via "Reset Password".

  2. Alternatively, you can create a separate Business Rule triggered after resetting a password for a user and send the email with the new password with the help of that Business Rule. However, in this case an email will be sent each time a user's password is reset, not only when the password is reset with your initial Business Rule.

    To create an additional Business Rule triggered after resetting a password that sends the new password by e-mail:

    • Create a new Business Rule.
    • On the 2nd step of the Create Business Rule, select User and After Resetting password for a User.
    • On the 3rd step, add the Send e-mail notification action.
    • In the Action Parameters section, configure the e-mail template. To include the new password in the e-mail, use the %unicodePwd% value reference.

Related questions

0 votes
1 answer

When enrolling a user for self-service with Adaxes, does this qualify them to reset their passwords via Microsoft Online as well? A lot of our SaaS products use Microsoft ... policies? I.e. Security Questions setup with Microsoft Account, MFA etc. Thanks, Dean

asked Jul 14, 2020 by dcallaghan (20 points)
0 votes
1 answer

We are trialing Adaxes and are wondering the following two things are possible. Is it's possible to have the order of Authentication methods adjusted ? Is it possible to import an ... 't look to exist, but would it be viable to add them as feature requests ?

asked Jul 6, 2020 by dgrandja (70 points)
0 votes
1 answer

is it possible to allow a user to enroll for both options, or even only one option out of the two available? I would like to give my users the choice to use either. Some users may not want an authenticator, but other's might do.

asked Nov 6, 2019 by mashworth (80 points)
0 votes
1 answer

Hi, we are using a scheduled job in Adaxes to notify users that their password will expire in x days. Now, we as IT were approached by Marketing to set up all ... ;/div> </body> </html> Your help would be highly appreciated kind regards Ingemar

asked Mar 2, 2015 by ijacob (960 points)
0 votes
1 answer

Hello! We are using the current version of Adaxes and are in the process of making the password self-service available to our users. We have installed the self-service client ... are doing wrong? Thanks Erik [EDIT]: Corrected image links. Sorry about that...

asked Jun 6, 2014 by eventit (160 points)
3,542 questions
3,233 answers
8,227 comments
547,808 users