SamAccount name generator
Top  Previous  Next


The SamAccount generator automatically creates unique series SAM account names from scratch or short unique letterpicker account names from other names. The format is specified in the SamAccount name generator settings. Account names are inserted in the Generator.UserName.DestCol column of the [Data] section, one name per row. All generated account names are automatically compared with existing SAM account names on the first server in the [Machines] section. When a duplicate is found, a trailing number is added or an existing trailing number is increased.

Linux and Novell notice: the SamAccount name generator only works on Windows servers, instead please see these exemples:
·Generate unique Linux user names and random passwords  
·Generate unique Novell user names and random passwords  

Start the SamAccount name generator manually by clicking Action > Run username generator > Name type. Create SamAccount names automatically from a script by adding a Data.Usernames.Generate command to the [Init] section. Use the Print data section function to print account names.

Notice

Account names longer than seven characters can be a problem if you need to create hidden shares for W9x clients. Read more: About home directories for different Windows clients.

You might not want to use the SamAccount name generator for Windows 2000 server

The SamAccount generator was originally written for Windows NT 3.51 and NT 4.0. It works on Windows 2000 and 2003 server, but since Windows 2000 and 2003 server also has other account names than the SAM name (read more here), and since Windows 2000 and 2003 server normally uses AD commands instead of SamAccount commands, you probably want to use the technique described in the example Clean up data and generate unique Windows 2000 server user names instead of the SamAccount name generator.



Series account name generator

The series account name generator creates account names on the form fixed prefix + number series ("user", "user2", "user3"). Account names are generated from scratch - no list of existing names are needed. Tip: the series account names generator can be very useful when you quickly need to create many account names for testing purposes.

Use the setting Generator.UserName.DestCol to specify destination column, Generator.Username.Series.Prefix to specify prefix and Generator.Username.Series.Count to specify number of names to generate, maximum is 5000.

Script example

[Settings_Begin]
Generator.UserName.DestCol=2
Generator.Username.Series.Prefix=USR
Generator.Username.Series.Count=5

BatchSettings.Delimiter=TAB
Account.Password.Col=3
BatchSettings.MarkerCol=4
[Settings_End]

[Machines_Begin]
\\EDU8      NT PDC    
[Machines_End]

[Init_Batch_Begin]
Data.Usernames.Generate Series   
[Init_Batch_End]

[Batch_Begin]
Data.Loop   
 Account.Create %col2%
Data.Endloop   
[Batch_End]

[Data_Begin]
   USR1      
   USR2      
   USR3      
   USR4      
   USR5      
[Data_End]


Here SetupBatcher has generated the account names "USR1", "USR2", "USR3", "USR4" and "USR5" in the second column of the [Data] section. Notice that the script will stop since there are no passwords in the third column, use the password generator to create passwords.

Letterpicker account name generator


The letterpicker account name generator creates short easy-typed account names by picking letters from a list of first and last names. ("Steve Jones" -> "SJ", "Cynthia Barnes" -> "CB", next "Cynthia Barnes" -> "CB2").

You can pick any number of letters from any word in any column in the [Data] section. It is possible to create very short user names since SetupBatcher will make sure that all of them are unique when generated. This is done by importing all accounts from your server and comparing them to the new user names. If there are two equal names, SetupBatcher will add a trailing number to the new user name to make it unique.

Use the setting Generator.UserName.DestCol to specify destination column and Generator.Username.Special.Format to specify how to pick letters.

Generator.Username.Special.Format syntax

Generator.Username.Special.Format=a,b,c,d,e ; [a,b,c,d,e] ; [..up to 5 groups]

a
source column
b
source word in column, 1=first word
c
start position, 1=start, 128=end
d
count (number of letters to pick)
e
pick direction, 0=forward, 1=backward


Example

Data section -

[Data_Begin]
Clinton Bill
Gates Bill
Lee Kuan Yew
Aung San Suu Kyi
[Data_End]


Generated User Names -

a,b,c,d,e
Clinton Bill
Gates Bill
Lee Kuan Yew
Aung San Suu Kyi
1,1,1,3,0
cli
gat
lee
aun
Second run
cli2
gat2
lee2
aun2
1,1,1,3,0 ;
1,1,1,3,0
clicli
gatgat
leelee
aunaun
1,1,1,3,0 ; 1,2,128,3,1
clilli
gatlli
leenau
aunnas
1,1,1,3,0 ; 1,2,128,3,1 ; 1,3,1,2,0
clilli
gatlli
leenauye
aunnassu


Script example

[Settings_Begin]
Generator.UserName.DestCol=2
Generator.Username.Special.Format=1,1,1,2,0 ; 1,2,1,2,0 ; 1,3,1,2,0
// source col, source word,pos (1=start, 128=end),count,dir (0=frwd, 1=bckwrd)

BatchSettings.Delimiter=TAB
Account.Password.Col=3
BatchSettings.MarkerCol=4
[Settings_End]

[Machines_Begin]
\\EDU8      NT PDC    
[Machines_End]

[Init_Batch_Begin]
Data.Usernames.Generate Special   
[Init_Batch_End]

[Batch_Begin]
Data.Loop   
 Account.Create %col2%   
Data.EndLoop   
[Batch_End]

[Data_Begin]
Clinton Bill   clbi      
Gates Bill   gabi      
Lee Kuan Yew   lekuye      
Aung San Suu Kyi   ausasu      
[Data_End]

Here SetupBatcher has generated the account names "clbi", "gabi", "lekuye", and "ausasu" in the second column of the [Data] section. Notice that the script will stop since there are no passwords in the third column, use the password generator to create passwords.