Generating a random password with the builtin Function Evaluator

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.

  1. 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.
  2. 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)
  3. 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.



2 Replies to “Generating a random password with the builtin Function Evaluator”

  1. Hello miss miis,

    I recently used this excellent trick. However, after using the suggestion for a larger audience of identities we noticed some abnormally long strings. Turns out the RandomNum needs to start with 1. If 0 is provided as the position value in the MID function then the entire input is returned.

    Thanks again for the example!!!

Leave a Reply

Your email address will not be published. Required fields are marked *