ADDUSERS (Command is Available in Windows Resource Kit)
AddUsers command to automate the creation of a large number of users, options can be use to never expire password and user don’t have to change password at next logon.
Syntax
Create Users:
AddUsers /c filename [/s:x] Domain_Name /p:{l|c|d|e}
Dump to file:
AddUsers /d:u filename [/s:x] Domain_Name
Erase Users:
AddUsers /e filename [/s:x] Domain_Name
Key
/c | Create User accounts, local groups, and global groups as specified by filename. |
/d:u | Dump user accounts, local groups, and global groups to filename. The (:u) is an optional switch that causes current accounts to be written to the specified file in Unicode text format. Choosing to dump current user accounts does not save the account’s passwords or any security information for the accounts. Note: Password information is not saved in a user account dump and if you use the same file to create accounts, all passwords of newly created accounts will be empty. To back up security information for accounts, use a Tape Backup. |
/e | Erase the user accounts specified in the file name. CAUTION: Be careful when erasing user accounts, as it is not possible to recreate an account with the same SID. This option will not erase built-in accounts. |
Filename | The comma-delimited file that AddUsers uses for data. |
/s:x | Optional switch that changes the character used for separating fields in the file e.g. /s: ~ field-separation character “~” If this option is not specified, the default separator, a comma, is used. |
Domain_Name | Query the Primary Domain Controller (PDC) of domain. You can also use \\Servername to specify the machine where user accounts are created or read. AddUsers will use the local computer by default (if you do not specify Domain) |
/p: | Set account creation options, used along with any combination of the following: l – Users do not have to change passwords at next logon. c – Users cannot change passwords. e – Passwords never expire. (implies l option) d – Accounts disabled. By default, all created users are required to change their password at logon. |
Example
Create a comma-delimited text file, which contains the new users to be created. Syntax as follows:
[Users]
User Name,Full name, Password, Description, HomeDrive, Homepath, Profile, Script
e.g.
[User]
Jim,James Phillip,,,,,,
Alex,Alex Denuur,,,E:\,E:\users\alexd,,
Ron,Ron Jarook,,,E:\,E:\users\ronj,,
Save the file as C:\NewUsers.txt and execute the command
AddUsers Domain_Name /c c:\NewUsers.txt /p:e