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

Show last authors
1 (% class="wikigeneratedid" %)
2 **Table of contents**
3
4 {{toc/}}
5
6 ----
7
8 = Description =
9
10 **importtools **is a tool to manage users in DigDash’s LDAP. It is particularly useful when handling a big user base.
11
12 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)
13
14 or
15
16 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).
17
18 java -jar importtools.jar [-conf configfile] [-users userfile] [-out outputfile]
19
20 With this tool, you can then administrate your users via the following operations.
21
22 = Importing users =
23
24 The tool needs two input files :
25
26 * 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.
27 * 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.
28
29 And one output file :
30
31 * 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.
32
33 = Removing users =
34
35 It is possible to remove all or a part (depending on conditions) of the users in LDAP.
36
37 = Exporting users =
38
39 It is possible to export the users from LDAP.
40
41 **Options:**
42
43 |=Tag|=Description
44 |(% colspan="2" %)**Importation**
45 |**-conf** <config file>|Path of the XML configuration file. By default, conf.xml
46 |**-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.
47 |**-out** <outputfile>|Path of the XML output file that maps with LDAP’s structure. By default, out.xml.
48 |**-help**|Command usage.
49 |**-debug**|Shows stack traces when fails.
50 |**-import**|Sends the output file (by default, out.xml) to the server to import in LDAP.
51 |**-importonly**|Uses an already existing output file (by default out.xml) and sends it to the server to import in LDAP.
52 |**-server**|Digdash server address.
53 |**-user**|The supervisor user.
54 |**-pass**|The supervisor user’s password
55 |(% colspan="2" %)**Suppression**
56 |**-removeall**|Removes ALL users in LDAP AND license.
57 |**-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.
58 |**-removeall** **-attr** "license_type" **-regexp** "extranet"|Special case : removes users in LDAP AND license if the license type is “extranet”.
59 |(% colspan="2" %)**Exportation**
60 |**-export**|Exports all LDAP users in a CSV file. By default, export file is named “users_export.csv”.
61 |**-exportfile** "file.csv"|Exports all users in a CSV named according to the specified absolute path (preceded by **-export**).
62 |(% colspan="2" %)**Logs**
63 |**-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.
64 |**-log** "C:\log.txt"|The log file will be created in the specified directory and with the specified name.
65 |(% colspan="2" %)**Autres**
66 |**-loginForm**|Forces the LDAP authentication in SSO case.
67
68 = Examples =
69
70 * **java -jar importtools.jar**
71 * **java -jar importtools.jar -conf conf.xml -users users.xls -out out.xml**
72 * **java -jar importtools.jar -conf conf.xml -users users.xls -out out.xml -import -server http:~/~/localhost:8080 -domain ddenterpriseapi -user admin -pass admi**
73 * **java -jar importtools.jar -export -server http:~/~/localhost:8080 -domain ddenterpriseapi -user admin -pass admin**
74 * **java -jar importtools.jar -export -exportfile "D:\my_users_export.csv" -server http:~/~/localhost:8080 -domain ddenterpriseapi -loginForm -user admin -pass admin**
75 * **java -jar importtools.jar -removeall -server http:~/~/localhost:8080 -domain ddenterpriseapi -user admin -pass admin**
76 * **java -jar importtools.jar -removeall -attr "license_type" -regexp "extranet" -server http:~/~/localhost:8080 -domain ddenterpriseapi -user admin -pass admin**
77 * **java -jar importtools.jar -removeall -attr "uid" -regexp "toto1[0-9]*" -server http:~/~/localhost:8080 -domain ddenterpriseapi -user admin -pass admin**