Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/13/2022 11:16 AM
Hi Team,
Json for Enable Account:
{
"USEDNFROMACCOUNT": "YES",
"MOVEDN": "YES",
"REMOVEGROUPS": "No",
"ENABLEACCOUNTOU": "${if(user.employeeType != 'df'){'OU=People,DC=ABC,DC=XYZ,DC=COM'} else {'OU=External,DC=ABC,DC=XYZ,DC=COM'}}",
"AFTERMOVEACTIONS": {
"userAccountControl": "512",
"userPassword": "${org.apache.commons.lang.RandomStringUtils.randomAlphanumeric(7)+'!@#$%^&*'.charAt((new Random().nextInt('!@#$%^&*'.length())))}",
"pwdLastSet": "0",
"description": "Rehired by Saviynt on ${user?.updatedate}"
}
}
I can see password is generated in log. But email is not getting triggered ,it 'seems there is issue for password attribute.
Email Template :
<div>*** This is an automated message ***</div><div>You are receiving this email because an Active Directory account has been created for ${user?.firstname} ${user?.lastname}(<% if(user?.employeeid !=null) print "${user?.employeeid}" else print "" %>).</div><div><br></div><div>The password for this account is : <% if(task?.password !=null) print "${task?.password}" else print "" %></div><div><% if(user?.employeeType.equalsIgnoreCase('AB')){%></div><div><br></div><div>The account information, including the Active Directory (AD) ID, will be communicated in a separate email.</div><div><%}else{%></div><div>The user's other account information, including user ID, will be communicated in a separate email.</div><div><br></div><div>As ${user?.firstname} ${user?.lastname}'s manager, we ask that you please provide this information to the user in a secure manner so the user may access the account.<%}%></div><div><br></div><div>
At the end point of Active Directory , configured this notification on 'Enable' Account.
Can you please share your inputs on this.
Thanks
Geeta
09/13/2022 01:48 PM
Hello @GeSaviynt,
You could try the following variables for password : randompassword/account_password.
Alternately, you could add the following in the email templates and see what variables are exposed and use accordingly.
${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}}
09/13/2022 09:57 PM
Hi,
Okay will try this. I used this attribute in Enable Account json 'userPassword' and in email template '${task?.password}' so instead of 'userPassword' have to used randompassword/account_password?
Thanks
Geeta
09/14/2022 03:42 AM
Use below code in email. Body for testing purpose to know which variables are exposed in enable account template & share screenshot
${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}}
09/13/2022 02:32 PM
09/13/2022 09:54 PM
1. Yes Enable task is created and completed also.
2. In log I can se email template name , from and to value replaced and there is no error.
3. Yes, I ran the job.