Import tools

Last modified by jhurst on 2020/10/29 13:32

Table of contents


Description

importtools is a tool to manage users in DigDash’s LDAP. It is particularly useful when handling a big user base.

The importtools can be directly launched via the provided command file “importtools.bat”, with the arguments by default (that you can modify editing the .bat file)

or

It can be executed via the Java tool “importtools.jar” provided in <digdash_install>\add-ons\tools\lib avec the arguments by default that you can change (see below).

java -jar importtools.jar [-conf configfile] [-users userfile] [-out outputfile]

With this tool, you can then administrate your users via the following operations.

Importing users

The tool needs two input files :

  • The configuration file in XML format : the sample file conf.xml already exists in <digdash_install>\add-ons\tools\importtools ; it contains a list of attributes corresponding to a user’s attributes in LDAP.
  • The users file in Excel or CSV format ; the sample file users.xls already exists in <digdash_install>\add-ons\tools\importtools ; it contains all the users (one user per line) to import in LDAP. Its columns correspond to the attributes in the XML configuration file.

And one output file :

  • The output file in XML format : it is named « out.xml » by default. It is generated after executing the « importtools » with the two previous input files ; the final file is generated so it can map with LDAP’s structure.

Removing users

It is possible to remove all or a part (depending on conditions) of the users in LDAP.

Exporting users

It is possible to export the users from LDAP.

Options:

TagDescription
Importation
-conf <config file>Path of the XML configuration file. By default, conf.xml
-users <excel file / csvfile>Path of the users to import in LDAP as input file. It can be an Excel file or a CSV file. By default, users.xml.
-out <outputfile>Path of the XML output file that maps with LDAP’s structure. By default, out.xml.
-helpCommand usage.
-debugShows stack traces when fails.
-importSends the output file (by default, out.xml) to the server to import in LDAP.
-importonlyUses an already existing output file (by default out.xml) and sends it to the server to import in LDAP.
-serverDigdash server address.
-userThe supervisor user.
-passThe supervisor user’s password
Suppression
-removeallRemoves ALL users in LDAP AND license.
-removeall -attr "ldap attribut name" -regexp "regexp"Removes all entries in LDAP AND license when specified attribute for a user in LDAP matches the mentioned regular expression.
-removeall -attr "license_type" -regexp "extranet"Special case : removes users in LDAP AND license if the license type is “extranet”.
Exportation
-exportExports all LDAP users in a CSV file. By default, export file is named “users_export.csv”.
-exportfile "file.csv"Exports all users in a CSV named according to the specified absolute path (preceded by -export).
Logs
-log "C:\temp"The log file will be created in the specified directory in the following way: importtool-yyyy-mm-dd_hh-mm-ss.log.
-log "C:\log.txt"The log file will be created in the specified directory and with the specified name.
Autres
-loginFormForces the LDAP authentication in SSO case.

Examples

  • java -jar importtools.jar
  • java -jar importtools.jar -conf conf.xml -users users.xls -out out.xml
  • java -jar importtools.jar -conf conf.xml -users users.xls -out out.xml -import -server http://localhost:8080 -domain ddenterpriseapi -user admin -pass admi
  • java -jar importtools.jar -export -server http://localhost:8080 -domain ddenterpriseapi -user admin -pass admin
  • java -jar importtools.jar -export -exportfile "D:\my_users_export.csv" -server http://localhost:8080 -domain ddenterpriseapi -loginForm -user admin -pass admin
  • java -jar importtools.jar -removeall -server http://localhost:8080 -domain ddenterpriseapi -user admin -pass admin
  • java -jar importtools.jar -removeall -attr "license_type" -regexp "extranet" -server http://localhost:8080 -domain ddenterpriseapi -user admin -pass admin
  • java -jar importtools.jar -removeall -attr "uid" -regexp "toto1[0-9]*" -server http://localhost:8080 -domain ddenterpriseapi -user admin -pass admin