A Forum reader recently asked:

“Are there any available examples for generating a random password as a part of user creation?”

And here’s the response from Arno Dorenbusch …


Here is the sample code for what you want to do. Note that in the translation, numbers “0123456” are replaced by “abcdefg”:

<policy xmlns:random="">


<description>generate Password</description>



<if-class-name mode="nocase" op="equal">User</if-class-name>




<do-set-local-variable name="randomNumberGenerator">


<token-xpath expression="random:new()"/>



<do-set-local-variable name="randomNumber">


<token-xpath expression="random:nextLong($randomNumberGenerator)"/>



<do-set-local-variable name="complexPassword">


<token-xpath expression="translate($RandomNumber,'0123456','abcdefg')"/>





<token-local-variable name="complexPassword"/>



<do-status level="warning">


<token-text xml:space="preserve">Generated Password is: </token-text>

<token-local-variable name="complexPassword"/>





0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.

Disclaimer: As with everything else at NetIQ Cool Solutions, this content is definitely not supported by NetIQ, so Customer Support will not be able to help you if it has any adverse effect on your environment.  It just worked for at least one person, and perhaps it will be useful for you too.  Be sure to test in a non-production environment.

Leave a Reply

No Comments
Nov 29, 2006
12:00 am
Active Directory Authentication Automation Cloud Computing Cloud Security Configuration Customizing Data Breach DirXML Drivers End User Management Identity Manager Importing-Exporting / ICE/ LDIF Intelligent Workload Management IT Security Knowledge Depot LDAP Monitoring Open Enterprise Server Passwords Reporting Secure Access Supported Troubleshooting Workflow