Active Directory, set AD password with random password set to FALSE.

aundreb
Regular Contributor
Regular Contributor

Hello,

I'm having some issues setting a custom password following a password formula with randompassword set to FALSE. Initially I was using the userPassword property to set a custom password using the below code which still set a random password

 

"userPassword": "${user?.lastname.charAt(0).toUpperCase() + user?.lastname.charAt(1).toLowerCase() + user?.customproperty63 + user?.username.substring(user?.username.length() - 3) + user?.customproperty64.substring(user?.customproperty64.length() -2)}"

 

I switched to using UnicodePwd instead of userPassword, which worked partially. It translated the first part of my password formula that grabs the first two letters of a users lastname and translated into numbers. For example, what should have translated to Si15220418 came out as 17715220418.

 

"UnicodePwd": "${user?.lastname.charAt(0).toUpperCase() + user?.lastname.charAt(1).toLowerCase() + user?.customproperty63 + user?.username.substring(user?.username.length() - 3) + user?.customproperty64.substring(user?.customproperty64.length() -2)}"

 

Any solution to this?

Thanks,

Aundre

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

Can you provide logic with examples what should be password


Regards,
Rushikesh Vartak
If the response is helpful, please click Accept As Solution and kudos it.

aundreb
Regular Contributor
Regular Contributor

Check the original post, logic and example is there.

 

 

"UnicodePwd": "${user?.lastname.substring(0, 1).toUpperCase() + user?.lastname.substring(1,2).toLowerCase() + user?.customproperty63 + user?.username.substring(user?.username.length() - 3) + user?.customproperty64.substring(user?.customproperty64.length() -2)}"

 

 


Regards,
Rushikesh Vartak
If the response is helpful, please click Accept As Solution and kudos it.

sk
All-Star
All-Star

Just change index for last name from (0,1) to (1,2) in the JSON shared by Rushi to match your logic


Regards,
Saathvik
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.

musthak_ahamad
Regular Contributor
Regular Contributor

is it working ..?