We’ve all found that the Function Evaluator is frustratingly limited, and the only random function is for a number – so how can you generate a random password?
You can write your own activity, or use Tools4FIM, but I’ve been trying to use the OOB activities as much as possible so here’s what I ended up with.
- Start with one FE that puts a 100 characterÂ string into [//WorkflowData/SeedString]. The string should be a random assortment of characters. There are plent of random character generators on the internet you can use to create one.
- Follow up with a number of FEs that take sub-strings at random intervals from your seed string, eg:
[//WorkflowData/s1] = Mid([//WorkflowData/SeedString],RandomNum(1,99),2)
- Then finally concatenate your substrings:
[//WorkflowData/Password] = [//WorkflowData/s1] + [//WorkflowData/s2] + [//WorkflowData/s3] + …
If you want to ensure there are a mix of upper and lower case you could wrap one or more of the substrings in LowerCase() or UpperCase().
If you want to ensure you have numbers and/or punctuation then you could start with different seed strings for each character type.
It’s not pretty but probably ok for most purposes.