Products: IMail Server Plus, IMail Server Premium, IMail Server

Create users from the command line with adduser

« Go Back


How can I add IMail users from the command line?

IMail includes a command line utility named adduser.exe which can add users to your hosts.

Run: adduser.exe /?
You will see a description of the accepted parameters. Find adduser.exe in your \imail directory.

You can write scripts or programs which call adduser.exe.

Adduser writes to the registry of the PC you run it on, so it will not work to run it on a mapped drive from another machine.

Adduser works with domains which use the IMail user database or an external user database. Adduser will not add users to domains which use the Windows NT user database for authentication.

The command line utility adduser.exe can import users from a comma-delimited text file.

Description: Adduser is an IMail utility that can be used to add, modify or delete users in the IMail system via the command line, a file or standard input.

Adduser [-h hostname] [-kill] [-mod] [-u userid] [-n name] [-p password]
[-f filename] [-?]

-h hostname optional argument used to specify the virtual host for the user.
-kill delete userid
-mod modify userid
-u userid specify userid
-n name specify full name of user
-p password specify password for user (default is 'password')
-q disable alias duplicate check
-c, optional argument used to specify an alternate delimiting character where you would replace the default delimiter (a comma) with the desired
delimiter (space is not allowed).
-f filename name of file containing commands (all above commands are valid in a file; note that -h and -c persist across multiple lines of input).
-chgpass disable user ability to change password
-web disable user ability to use web
-active disable user ability to logon
-info disable user display in whois, finger and LDAP
+chgpass enable user ability to change password
+web enable user ability to use web
+active enable user ability to logon
+info enable user display in whois, finger and LDAP
-? summary of command options
# : ; Comments (in a file)

Return codes:

This program returns 1 if it performed at least one of the requested
operations and returns 0 if it failed.


Following five examples add a userid of test01
Adduser test01
Adduser -u test01
Adduser -u test01 -n "mr test" -p hispass
Adduser -h -u test01 -n "ms test" -p yourpass

Following examples delete a userid
Adduser -kill -u test01
Adduser -h -k test01


The primary IMail host is used if no host is specified. Only one userid may be added, modified or deleted on a single command line. Files may be used to contain multiple commands for one execution.

Adduser will accept command input via stdin and sends all output to stdout. If you invoke Adduser with no command line options, you can manually input command lines, pressing Enter after each line and CTRL-Z when complete. You can also redirect input as in "Adduser < filename" or
"myprog | Adduser".

New users will all have the WEB option enabled unless one of the option modifiers (-/+chgpass, -/+web, -/+active, -/+info) are specified. Modifying users will not change a users option unless ANY of the option modifiers are specified. If any option is specified then all options are enabled except the
specified options.

Sample file:

userid,password,full name
smith,whypass,Mrs Smith
test1,,Mr Smith
jones,okpass,Tom Jones

Sample output running above file:
D:\IMAIL>Adduser -h wks013 -c, -f test.txt
current host is
OK: added userid to host
OK: added smith to host
OK: added test1 to host
OK: added jones to host

To create the mailbox folders for the users which are not created by default with adduser go to each domain in IMail Administrator. On the Users folder select "Global User Changes". Do not change anything and click "Change ALL accounts". This will create all the folders for you.

See also:
IMail - How to to create an IMail System Administrator user using adduser.exe

Version8.2x; 2006.0x; 2006.1; 2006.2x; 10; 10.01; 10.02

Customer Service Softwaresalesforce.comHome | Product