The 20 Minute E-mail Solution!
TOC PREV NEXT INDEX

Adding Users (adduser.exe)


Adduser.exe is a utility for adding, modifying, or deleting users, but can only be used if the domain is based on either an IMail database or on an external database. (Adduser.exe cannot be used to add users to domains which use the Windows NT database.)

You can use adduser.exe to add users whose user IDs and passwords are stored in a text file. Passwords must be between 3 and 30 characters.
Note: Using the adduser.exe utility to create users does not apply the default user settings as defined in IMail Administrator.

If you invoke adduser with no command line options (by typing only adduser at the MS-DOS prompt), you can then manually input command lines, pressing Enter after each line. If you do this, press CTRL-Z to exit the utility when you are done.

Basic Command Syntax

Adduser.exe [-h hostname] [-k userid] [-m userid] [-u userid]
       [-p password] [-n name] [-f filename] [-l] [
        [

Command Option Function
-h hostname Use the -h argument to specify the user's virtual host, where hostname is the name of the host. The primary IMail host is used if no host is specified. (When you use -h in a text file, it affects all lines in the file.)
-k userid Use the -k argument to delete a user id, where userid is the id you want to delete. Only one user id may be deleted in a single command line.
-m userid Use the -m argument to modify a user id, where userid is the id you want to modify. Only one user id may be modified in a single command line.
-u userid Use -u to add a user id, where userid is the id you want to add. Only one user id may be added in a single command line.
-n "name" Use -n to specify the full name of the user in double quotes, where name is the user's full name.
-l Adds the reply-to address and user address to the LDAP database
-p password Use -p to specify a password for the user, where password is the user's password. If you omit this parameter, the user's password is 'password.'
-q Use -q to disable alias duplicate check.
-cX Use -c to specify an alternate delimiting character where X represents the delimiting character. This tells adduser.exe to replace the default delimiter (a comma) with the specified delimiter. A space is not allowed. (When you use -c in a text file, it affects all lines in the file.)
-f filename You can put multiple commands into a text file for one execution of adduser.exe. Use the -f argument to specify the name of the file containing the adduser.exe commands. (All commands are valid for the text file, but note that -h and -c persist across multiple lines).
-chgpass Use -chgpass to disable the user's ability to change password.
+chgpass Use +chgpass to enable the user to change password.
-web Use -web to disable the user's ability to use Web Messaging.
+web Use +web to enable the user to use Web Messaging.
-active Use -active to disable the user's ability to log on.
+active Use +active to enable the user to log on.
-info Use -info to disable display of the user in whois, finger and LDAP queries.
+info Use +info to enable display of the user in whois, finger and LDAP queries.
-? Use -? to see a summary of argument options.
# : ; Comments (for use in a text file)

Adding a User ID

The following examples add a user ID of test01.

Adduser -h myhost.com -u test01 -n "ms test" -p yourpass 
Adduser -u test01 -n "mr test" -p nopass
Adduser -u test01
Adduser test01 

Deleting a User ID

The following examples delete a user ID.

Adduser -k -u test01 
Adduser -h another.net -k test01 

Return Codes

Adduser returns 1 if it performed at least one of the requested operations; adduser returns 0 if it failed.

Using a Text File

Instead of entering commands at the MS-DOS prompt, you can use a text file to input multiple commands for one execution of adduser.exe. You can use this technique to add users to your IMail Server system from another mail system if the other mail program can create a delimited text file of user ids, passwords, and user names.

Suppose you want to add four user IDs (userid, smith, test1, and jones) to the wks013 server. Adduser.exe assumes that if there are no arguments in a text file, then the information on each line is userid, password, and full name - in that order.

For example, you could create a text file named addfour.txt that contains the following lines:

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

At the MS-DOS prompt, you enter:

Adduser -h station1.ipswitch.com -f addfour.txt 

You then get the following messages:

current host is wks013.augusta.ipswitch.com
OK: added userid to host station1.ipswitch.com
OK: added smith to host station1.ipswitch.com
OK: added test1 to host station1.ipswitch.com
OK: added jones to host station1.ipswitch.com 

Note that the user named test1 will have "password" (the default) as his password.

Disabling Web Options

New users have all the Web options enabled unless you disable one of them (-/+chgpass, -/+web, -/+active, -/+info) in the command line. Modifying a user does not change the user's Web options unless you include at least one of the Web arguments in the command line: if you include any web argument, then all Web options are enabled except those you specifically disable.

Sample File

#Entries below default to Primary domain automatically. 
#Adds user test100 with password nopass, and full name Mr. Test100 
test100,nopass,"Mr. test100" 
#adds user test101 with password nopass, name of Ms. Test101,  
#has ability to #change own password, access from web,  
#account is not disabled, user info is accessible from outside. 
-u test101 -p nopass -n "Ms. test101" +chgpass +web +active +info 
#Add user killthisone 
-u killthisone 
#Remove user killthisone 
-k killthisone 
#Change domain(host) 
-h virtual001 
#Change delimiter from default(,) to a (+). 
-c+ 
#Add user test100 with password of password and name of Mr. Test100 
test100+password+"Mr. Test100" 
#Modify user test100 with new name of Mrs. Test100 
-m -u test100 -n "Mrs. Test100" 
#Change domain(host) 
-h virtual002 
#Change delimiter back to default 
-c, 
#Add user test101 with password nopass and name Mrs. Test101 
test101,nopass,"Mrs. test101" 
#Add user test103 with default password, with default name test103, has #ability to change own password, access from web, account is not disabled, user #information is accessible from outside. 
-u test103 +chgpass +web +active +info 
#Add user test104 with default password, with default name test103, has #ability to change own password, access from web, account is not disabled, user #information is not accessible from outside. 
-u test104 -chgpass +web +active -info 
#Modify user test103 so user information is not accessible from outside. 
-m test103 -info 

Results from running the above file:

current host is mail.some.where.com 
OK: added test100 to host mail.some.where.com 
OK: added test101 to host mail.some.where.com 
OK: added killthisone to host mail.some.where.com 
OK: User "killthisone" removed from " mail.some.where.com ". 
INF: current host is virtual001 
OK: added test100 to host virtual001 
OK: user test100 modified in virtual001 
INF: current host is virtual002 
OK: added test101 to host virtual002 
OK: added test103 to host virtual002 
OK: added test104 to host virtual002 
OK: user test103 modified in virtual002 



Ipswitch, Inc.
http://www.ipswitch.com
TOC PREV NEXT INDEX
©Ipswitch 2004