Lat-groups

From SME Server
Jump to navigationJump to search

lat-groups

The lazy administrator's tool to create groups and to add members to it.

DESCRIPTION

      Creates or deletes groups on Mitel's SME servers (5.x/6.x).  This tool
      is functionally equivalent to the 'groups' option in the server-man-
      ager, but can be run from the command line or called from an other
      script.  It allows you, for example, to add a large number of accounts
      to a group, or delete groups on a remote machine via an ssh console.
      See /usr/doc/lazy-admin-tools/example.groups for the format of the
      input file.

SYNOPSIS

      lat-groups -a [-n] -c "group | descr. | gid | user1| user2"
      lat-groups -a [-n] -i /path/to/groups.list
      lat-groups -r [-f] -c "group | user1 | user2"
      lat-groups -d [-f] -c "group"
      lat-groups -d [-f] -i /path/to/groups.list

Smecontribs repository for SME Server 8.0

yum install --enablerepo=smecontribs smeserver-lazy_admin_tools
signal-event post-upgrade; signal-event reboot

OPTIONS

      The following options are supported:
      -a, --add
          Add a group to the server, or add users to an existing group.
      -c ""Arguments"", --command-line=""Aruments""
          Take arguments from the command line.  See the 'Arguments' section
          below for the various arguments that are accepted.
      -d, --delete
          Delete a group 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 group(s).
          See /usr/doc/lazy-admin-tools for an example of an input file.
      -n, --no-admin
          Do not add 'admin' and 'www' as users to this group. Remove them if
          they are already member of this group.
          Default behaviour on SME is to add both users to any group, thus
          limiting the number of groups on the server to 28.  Note, however,
          that SME is very persistent with this 'feature'. Each time you add
          or remove a user via the server-manager, both 'admin' and 'www' are
          added again.
      -r, --remove-users
          Remove users from this group.  Wildcards (* and ?) are accepted for
          the groupname.
      Arguments:
         group*     : 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 groups.
         descr.     : Free-text description of the group
         gid        : Group ID. If omitted, a suitable gid will be generated.
         member(s)  : Username of a member of the group. Must be an
                      existing account on the server.
         * mandatory field

EXAMPLES

lat-groups -a -c "hogwarts | School of Witchcraft |  | harry |
      hermione"
      Creates group 'hogwarts' with users 'harry' and 'hermione'.
lat-groups -a -i /root/griffindor.list
      Creates the groups defined in /root/griffindor.list.  Refer to
      /usr/doc/lazy-admin-tools/example.groups for an example of an input
      file.
lat-groups -a -n -i /root/griffindor.list
      Creates the groups defined in /root/griffindor.list.  The users 'admin'
      and 'www' are *not*  added to the group.
lat-groups -d -f -c "class*"
      Deletes all groups whose name start with 'class'.  All groups are
      deleted without prompting (-f).
lat-groups -r -f -c " * | admin | www"
      Removes users 'admin' and 'www' from all groups on the system.  Don't
      prompt before removing.
lat-groups -a -c "quidditch | Different ball game | 7005"
      Creates group 'quidditch' with group ID 7005.