Skip to end of metadata
Go to start of metadata

Introduction

This page shows the commands available in the bm-cli tool as in the latest version released.

If you cannot find a command in your system, make sure you update your BlueMind installation to the latest version.

On this page:

Related:

CLI Admin Client

User Management

The "user" command offers 3 sub-commands:

  • get (to retrieve information)
  • delete
  • update
  • logout : déconnecte l'utilisateur de toutes les sessions en cours
  • export : exporte l'ensemble des données de l'utilisateur (emails, contacts, calendriers et tâches) dans une archive tgz
    supporte l'argument --match afin d'exporter un groupe d'utilisateur correspondant à une expression régulière

Each of these commands takes at least one of the following arguments:

  • an email address to apply the action to a user
  • a domain address to apply the action to all domain users
Examples
bm-cli user get user@domain.net			#returns the information for the user whose address is email user@domain.net
bm-cli user get domain.net				#returns the information for all the users of domain.net
bm-cli user get domain.net --archived	#returns all archived users
bm-cli user get domain.net --hidden		#returns all hidden users (for whom the box "Hide from address lists" has been checked)
bm-cli user get domain.net --archived --display "email uid"	#returns the email address and UID of archived users
bm-cli user delete user@domain.net		#deletes the user user@domain.net
bm-cli user delete domain.net			#deletes all users in the domain.net
bm-cli user update user@domain.net --password "OtherPassword" --quota "5G" #sets the password for the user user@domain.net to OtherPassword and assigns this user a 5GB quota
bm-cli user update user@domain.net --extId '0123456789'		#sets the external ID for user@domain.net to 0123456789
*bm-cli user update --quota 3G domain.net	#sets the quota to 3GB for all domain users
*bm-cli user logout user@domain.net		#coupe toutes les connexions actives de l'utilisateur user@domain.net
**bm-cli user export user@domain.net		#exporte les données de user@domain.net dans un fichier user@domain.net.tgz et la place dans le dossier /tmp/bm-export/
**bm-cli user export user@domain.net --match [a-c].*	#exporte les données des utilisateurs dont l'identifiant commence par les lettres a, b et c

*available from BlueMind 3.5.12
**available from BlueMind 3.5.13

For more information on the arguments for each command, type:

# bm-cli help user <command>

Contact Management

The "contact" command has the following sub-commands:

  • list: list of address books for a user or the whole domain
    Returns the following data as a group:
    • UID
    • address book UID
    • address book name
  • import: imports contacts from a VCard into a user's address book 
    • expects the argument --vcf-file-path showing the full file path for the file to import from
  • export: exports all the address books of a user to a VCard file
    • accepts the argument --addressbook-uid to export one address book only
      Note: in BlueMind version 3.5.12 and below, the "export" command can only export one address book at a time and therefore always expects this argument 
    • accepts the argument --output-directory to specify the file destination folder – if no folder is specified, the address book will be exported to the /tmp folder
  • reset: empties an address book
  • deduplicate: deletes duplicated contacts from an address book

    Deduplicate and memory usage

    Warning! This operation can be extremely resource hungry when dealing with large address books. In such cases, you should assign more memory to the service beforehand.

    To do this, edit the file /etc/bm/local/bm-cli.ini with the required values:

    MEM=256
    DMEM=256
    1. If the file exists already: edit it or add the lines
    2. If the file doesn't exist: create it and simply add these two lines

    Note: the default value is 128. We recommend that you increase it gradually by testing the results after each edit (i.e.: 256, then if it doesn't work 512, etc.)

    Note 2: There is no need to restart the service after editing the value: the commands can be run straight away, the new value is applied automatically.

    After the process is complete, we recommend that you reduce the memory assigned again so as not to use memory unnecessarily for other operations that don't require as much memory.

Each of these commands accepts at least one of the following arguments:

  • an email address to apply the action to a user
  • a domain to apply the action to all domain users
Examples
bm-cli contact list user@domain.net --workers 4		#lists all address books for all domain users by working on 4 threads
bm-cli contact import user@domain.net  --vcf-file-path /tmp/contacts.vcf --dry --addressbook-uid book:Contacts_0123456789			#tests the file import for /tmp/contacts.vcf to the user's personal address book
bm-cli contact export user@domain.net --addressbook-uid book:CollectedContacts_0123456789 	#exports the collected contacts address book for user@domain.net
*bm-cli contact export --output-directory /home/user/export/contacts user@domain.net		#exports all the user's address books from the folder /home/user/export/contacts
bm-cli contact reset user@domain.net  --addressbook-uid book:CollectedContacts_0123456789		#resets the collected contacts address book for user@domain.net
bm-cli contact deduplicate user@domain.net --addressbook-uid book:CollectedContacts_0123456789	#deletes duplicates in the collected contacts address book for user@domain.net

*available from BlueMind 3.5.13

For more information on arguments for each command, type:

# bm-cli help contact <command>

Calendar Management

The "calendar" command has the following sub-commands:

  • list: lists the calendars for a user or the whole domain
    Returns the following data as a group:
    • UID
    • calendar UID
    • calendar name
      Note: default user calendars bear the user's name
  • import: imports events from an ICS file into the calendar 
    • expects the argument --ics-file-path showing the full file path for the file to import
  • export: exports all the calendars for a user to an ICS file 
    • accepts the argument --calendarUid to export one calendar only
      Note: in BlueMind version 3.5.12 and below, the "export" command can only export one calendar at a time and therefore always expects this argument
    • accepts the argument --output-directory to specify the file destination folder – if no destination folder is specified, the export will be made to the /tmp folder
  • reset: empties a calendar

Each of these commands accepts at least one of these arguments:

  • an email address to apply the action to a user
    • in this case, specifying the user's calendar UID can be useful when a user has several calendars. If no calendar is specified, the default calendar will be used.
      This UID can be obtained easily using the list command
  • a domain to apply the action to all domain users
Examples
bm-cli calendar list user@domain.net	#lists the calendars for user@domain.net
bm-cli calendar list domain.net			#all the calendars of all domain users
bm-cli calendar import user@domain.net --calendarUid calendar:Default:A1B2C3D4E5F6Z --ics-file-path /tmp/user_default.ics --dry			#imports events from the user_default.ics file into the default calendar for user@domain.net
bm-cli calendar import user@domain.net --calendarUid 52D431FC-395A-49F8-A771-7805B1B78320 --ics-file-path /tmp/cal-externe.ics --dry	#tests the import from the cal-externe.ics file into the secondary calendar for user@domain.net
bm-cli calendar reset user@domain.net --calendarUid calendar:Default:A1B2C3D4E5F6Z	#empties the default calendar for user@domain.net
bm-cli calendar export user@domain.net --calendarUid 52D431FC-395A-49F8-A771-7805B1B78320 --dry	#tests the export of the secondary calendar for user@domain.net into the file /tmp/user_default.ics
*bm-cli calendar export --output-directory /home/user/export/cals user@domain.net 	#exports all the user's calendars to the file /home/user/export/cals

*available from BlueMind 3.5.13

For more information about the arguments for each command, type:

# bm-cli help calendar <command>

Maintenance

Maintenance actions are:

  • repair: repairs a user or all domain users
  • consolidateIndex: consolidates a user's index
    This command can take 2 settings to limit the number of users processed:
    • --from: the number for the entity in the list (offset) to start from
    • --size: the number of entities to process

Maintenance actions can take the following arguments:

  • an email to apply the action to a user
  • a domain to apply the action to all users
    • --numworkers: specifies the number of threads when the repair is performed on the whole domain
bm-cli maintenance repair user@domain.net			#repairs the user @domain.net
bm-cli maintenance repair domain.net				#repairs all domain users
bm-cli maintenance repair domain.net --numworkers 4	#repairs all domain users using 4 threads
bm-cli maintenance consolidateIndex user@domain.net	#consolidates the index for the user user@domain.net
bm-cli maintenance consolidateIndex domain.net		#consolidates the index for all users in the domain domain.net
bm-cli maintenance consolidateIndex domain.net --workers 4	#consolidates the index for all users in the domain domain.net using 4 threads
bm-cli maintenance consolidateIndex domain.net --from 0 --size 100 #processes the first 100 users returned
bm-cli maintenance consolidateIndex domain.net --from 101 --size 50 #processes the next 50 users 
bm-cli maintenance consolidateIndex domain.net --match '[a-c].*' #processes the entities that start from a, b or c

The --match command is supported from version 3.5.12

For more information on arguments on each command, type:

# bm-cli help maintenance <command>

Installation

The subscription includes automatic BlueMind updates, as well as the related additional bm-cli client operations.

To do this, you need to install the plugin:

apt install bm-plugin-cli-setup

The additional "setup" command is then available:

bm-cli help setup	#for help on available arguments and how to use them
bm-cli setup install --external-url bluemind.domain.net --domain domain.net --sw-pass Passw0rd
bm-cli setup install --external-url bluemind.domain.net --domain domain.net --sw-pass Passw0rd --set-contact admin@domain.net --reinstall
  • --external-url: BlueMind's external url 
  • --domain
  • --set-contact: sets the default email address for subscription expiry notifications
  • --sw-pass: sets the admin password for the setupwizard
  • No labels