Thursday, April 7, 2011

Utilizing the UMRA username generator for external systems.


The User Management Resource Administrator’s (UMRA) powerful name generator can be utilized for systems other than Active Directory such as Live@EDU or Google Apps.  Out of the box, the name generation algorithm is geared towards Active Directory.  The command scans the domain controller you have assigned to work with, and then attempts to create the account.  This is action is typically utilized within the Create User (AD) script action, as part of a create user process for Active Directory. 
 
In order to use the name generator for an outside system, you must use the UMRA script action “Generate name(s)”.  This is located under the “Variable actions” group in your “Actions” pane within the UMRA console. 
The first step is to decide how you want to handle duplicate accounts.  Let’s use John Allan Doe and Jane Anne Doe as an example.  If your first method is to use the first initial of the first name, first initial of the middle name, and the full last name, you can see that both people would have the username of, “JADoe”.  We need to devise an alternate method so that both users can exist in this system.  A common method is to incrementally add a letter to one of the names you are truncating until you get a good result.  For this example, let’s add a letter to the first name until we are unique.  We will do this twice in addition to the original generation for a total of three possibilities.  For John, they would look like this: “JADoe”, “JoADoe”, and “JohADoe”.

Our next step is to generate the name based on your input data.  We will need to reference the correct variables that contain the name parts of the account, typically; %FirstName% %MiddleName% and %LastName%.  We will then need to apply the appropriate formatting functions to each variable to get the desired result.  The first name will be shortened to the first character, and the same for the middle name.  The last name will be left as is, so no formatting functions need to be applied.

Now we can copy this method by highlighting it and hitting the copy button.  We can give this method a new name; you will want to make it relevant to what the method is doing, for example, “JoADoe”.  At this point the copy contains all of the original formatting that you set for the first method, so all you have to do is modify the number of characters that you shorten the name down to “two”.  Continue this process until you have the desired number of methods set in the algorithm.

Finally you will use this function in your project to generate the name.  Then you will search your system for that name.  An If-Then-Else statement will evaluate the condition and create the account or jump back up to generate the name again. Here is an example of the code:

·         Generate Name
·         Search system for %UserName%
·         If-Then-Else
o   If %SearchResultCount% = 1 Then goto Generate Name
o   Else, Create account with %UserName%