Hi,
Our client wants all users to have 3 random digits in their username.
What I’ve used is a 2 digit randomly generated followed by a unique counter up to 9. However this doesn’t give 3 digits if the random 2 are unique.
I’ve tried doing some velocity scripting to manipulate the output to add a ‘0’ if there are only 2 numbers, but its not liking it.
I’m guessing that $input0 doesn’t work because the 0 is being interpreted as part of the variable name. You can try ${input}0 instead to get around that.
The syntax also appears to be off within your static transform - there shouldn’t be an attributes property in there directly. Should that go somewhere else? You should have your value in there, along with any variables you’re going to be using within the value (like $input).
The create ldap unique attributes works only for account id not for account name. If you want to check uniqueness for account name then we should write a attribute generator rule.
Hi @sup3rmark ,
Thanks for the spot with the ‘0’, but unfortunately that didn’t resolve the issue. I get what you are saying about the syntax, it feels and looks wrong, but I just wrapped the original code in the ‘input’ variable. I have a suspicion that what I’m trying to do isn’t feasible. I might just have to use a random 3 digit generator instead. The chances of the number replicating is very low, even considering we’ve got 500k users.
@Abhinov7 LDAP works fine for account name, this is the original code: