Lat-users
lat-users
The lazy administrator's tool to add user accounts
DESCRIPTION
Creates or deletes user accounts on Mitel's SME servers (5.x/6.x/7.x/8.x). This tool is functionally equivalent to the 'User accounts' option in the server-manager, but can be run from the command line or called from an other script. It allows you, for example, to create a large number of accounts in a batch process, or delete accounts on a remote machine via an ssh console.
See /usr/doc/lazy-admin-tools/example.users for the format of the input file.
See /usr/doc/lazy-admin-tools/example.users for the format of the input file.
Smecontribs repository for SME Server
yum install --enablerepo=smecontribs smeserver-lazy_admin_tools smeserver-userpanel smeserver-mailsorting signal-event post-upgrade; signal-event reboot
SYNOPSIS
lat-tools -a [-p] -c "user | first | last | password | department | company | street | city | tel | forward | email | uid | group1 [| group..]"
lat-users -a [-p] -i /path/to/users.list
lat-users -d [-f] -c "user"
lat-users -d [-f] -i /path/to/users.list
OPTIONS
The following options are supported:
-a, --add Add a user account to the server.
-n create pseudonyms firstname.lastname/firstname_lastname
-c ""Arguments"", --command-line=""Arguments"" Take arguments from the command line. See the 'Arguments' section below for the various arguments that are accepted.
-d, --delete Delete a user account from the server. Wildcards (* and ?) are accepted.
-f, --force Don't prompt before deleting.
-h, --help Extended help for this tool
-i=FILE, --input-file=FILE Use the information from FILE to create or delete the user accounts. See /usr/doc/lazy-admin-tools for an example of an input file.
-p, --passwords Generate random passwords for the users and write them to ./pass- words.new. If a password was supplied, this option will be ignored.
Arguments:
user* - Must contain only lower-case letters, numbers, hyphens, periods and underscores, and should start with a lower-case letter. Wildcards (* and ?) can only be used to delete users. first* - First name last* - Last name password - Password for the user (in clear-text!) department - Department company - Company street - Street name and number city - Zip & City tel - Telephone number forward - E-mail delivery: 'local', 'forward' or 'both' email - Forwarding e-mail adres uid - User ID. If omitted, a suitable uid will be generated. group(s) - Group name(s) to which the user should be added. If the group doesn't exist, it will be created.
* mandatory field
EXAMPLES
lat-users -a -c "harry | Harry | Potter | Quidditch" Creates user 'harry' from the command line, with password 'Quidditch'.
lat-users -a -c "harry ||| Quidditch" Update the account 'harry' with the new password 'Quidditch'.
lat-users -a -n -c "harry | Harry | Potter | Quidditch" Creates user 'harry' from the command line, with password 'Quidditch' and pseudonyms firstname.lastname/firstname_lastname
lat-users -a -i /root/users.list Uses the arguments specified in /root/users.list to create user accounts. Please refer to /usr/doc/lazy-admin-tools/example.users for an example of an input file.
lat-users -d -f -c "user*" Deletes all user accounts that start with 'user'. All users and their files will be deleted without prompting (-f).
lat-users -a -p -i /root/users.list Creates user accounts as defined in /root/users.list and generates a random password for each user. The names and passwords are written to ./passwords.new.
lat-users -a -c "ron | Ron | Weasley ||||||||| 6005" Creates user 'ron' with user ID 6005. All other fields (company, departments, etc.) are left empty.
lat-users -a -c "ron | Ron | Weasley |||||||||| quiddich | dada " Creates user 'ron' and assigns him to groups quiddich and dada. If any of these groups doesn't exist, it will be created.
Known issues
Large user database
it has been reported that large user imports might be really long ( 60s per user in SME server already containing 4000 users) (see bugzilla:7545).
This script is using sme internal processing. The purpose of doing so is to do everything that is included by other contribs.
S95ldap-update-simple is called with user-modify user-create, group-modify and group-create events. S56update-domain-group-maps is called with the same events. These events allow also the full creation of the user, but have the adverse effect to be really long during large user importation.
A workaround to avoid this could be to: - disable ldap in the db configuration during the import (if you have not enable ldap auth) - or temporally remove the link inside the events to this two scripts and create them back after import.
and revert bacj theses change after importation and then running the signal event once (user-modify)
Bugs
Please raise bugs under the SME-Contribs section in bugzilla and select the e-smith-lazy_admin_tools component or use this link .