Wiki source code of Outil d’importation d'utilisateurs
Last modified by jhurst on 2021/04/21 10:01
Hide last authors
author | version | line-number | content |
---|---|---|---|
2.5 | 1 | (% class="wikigeneratedid" %) | |
2 | **Table of contents** | ||
2.1 | 3 | ||
2.5 | 4 | {{toc/}} | |
5 | |||
2.1 | 6 | ---- | |
7 | |||
2.5 | 8 | = Description = | |
2.1 | 9 | ||
2.5 | 10 | **importtools **is a tool to manage users in DigDash’s LDAP. It is particularly useful when handling a big user base. | |
2.1 | 11 | ||
2.5 | 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) | |
2.1 | 13 | ||
2.5 | 14 | or | |
2.1 | 15 | ||
2.5 | 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). | |
2.1 | 17 | ||
18 | java -jar importtools.jar [-conf configfile] [-users userfile] [-out outputfile] | ||
19 | |||
2.5 | 20 | With this tool, you can then administrate your users via the following operations. | |
2.1 | 21 | ||
2.5 | 22 | = Importing users = | |
2.1 | 23 | ||
2.5 | 24 | The tool needs two input files : | |
2.1 | 25 | ||
2.5 | 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. | ||
2.1 | 28 | ||
2.5 | 29 | And one output file : | |
2.1 | 30 | ||
2.5 | 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 | |||
2.1 | 33 | |=Tag|=Description | |
2.5 | 34 | |**-conf** <config file>|Path of the XML configuration file. By default, conf.xml | |
35 | |**-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. | ||
36 | |**-out** <outputfile>|Path of the XML output file that maps with LDAP’s structure. By default, out.xml. | ||
37 | |**-help**|Command usage. | ||
38 | |**-debug**|Shows stack traces when fails. | ||
39 | |**-import**|Sends the output file (by default, out.xml) to the server to import in LDAP. | ||
40 | |**-importonly**|Uses an already existing output file (by default out.xml) and sends it to the server to import in LDAP. | ||
41 | |**-server**|Digdash server address. | ||
42 | |**-user**|The supervisor user. | ||
43 | |**-pass**|The supervisor user’s password | ||
2.1 | 44 | ||
2.5 | 45 | = Removing users = | |
2.1 | 46 | ||
2.5 | 47 | It is possible to remove all or a part (depending on conditions) of the users in LDAP. | |
2.1 | 48 | ||
49 | |=Tag|=Description | ||
2.5 | 50 | |**-removeall**|Removes ALL users in LDAP AND license. | |
51 | |(% style="color:#2ecc71" %)**//Before 2020R2 patch 20210302 ~://**| | ||
52 | |**-removeall -attr=**"ldap attribute name" **-regexp=**"attribute value or regular expression"|Removes all users whose specified ldap attribute value matches the regular expression. | ||
53 | |**-removeall -license_type=**"all.missing.forbidden.[user type]"|((( | ||
54 | Delete all users according to their type or status in the license: | ||
2.1 | 55 | ||
2.5 | 56 | * **all** : all user types/status | |
57 | * **missing **: missing users from the license | ||
58 | * **forbidden** : unallowed users | ||
59 | * **[user type]** : possible values are **named**, **extranet**, **concurrent**, **public**, **broadcast**. | ||
60 | None, one or many values are possible, separated with the character "." | ||
61 | Samples: named.extranet or missing.extranet.named | ||
2.1 | 62 | ||
2.5 | 63 | At least one of these parameters must be used. | |
2.1 | 64 | ))) | |
65 | |(% style="color:#2ecc71" %)**//Avant 2020R2 patch 20210302 ~://**| | ||
2.5 | 66 | |**-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. | |
67 | |**-removeall** **-attr** "license_type" **-regexp** "extranet"|Special case : removes users in LDAP AND license if the license type is “extranet”. | ||
68 | |(% colspan="2" %)**Exportation** | ||
69 | |**-export**|Exports all LDAP users in a CSV file. By default, export file is named “users_export.csv”. | ||
70 | |**-exportfile** "file.csv"|Exports all users in a CSV named according to the specified absolute path (preceded by **-export**). | ||
2.1 | 71 | ||
2.5 | 72 | = Exporting users = | |
2.1 | 73 | ||
2.5 | 74 | It is possible to export the users from LDAP. | |
2.1 | 75 | ||
2.5 | 76 | **Options:** | |
2.1 | 77 | ||
78 | |=Tag|=Description | ||
2.5 | 79 | |**-export**|Exports all LDAP users in a CSV file. By default, export file is named “users_export.csv”. | |
80 | |**-exportfile** "file.csv"|Exports all users in a CSV named according to the specified absolute path (preceded by **-export**). | ||
2.1 | 81 | ||
2.5 | 82 | (% class="wikigeneratedid" %) | |
83 | = General parameters = | ||
2.1 | 84 | ||
85 | |(% colspan="2" %)**Logs** | ||
2.5 | 86 | |**-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. | |
87 | |**-log** "C:\log.txt"|The log file will be created in the specified directory and with the specified name. | ||
2.1 | 88 | |(% colspan="2" %)**Autres** | |
2.5 | 89 | |**-loginForm**|Forces the LDAP authentication in SSO case. | |
2.1 | 90 | ||
2.5 | 91 | = Examples = | |
2.1 | 92 | ||
93 | * **java -jar importtools.jar** | ||
94 | * **java -jar importtools.jar -conf conf.xml -users users.xls -out out.xml** | ||
2.5 | 95 | * **java -jar importtools.jar -conf conf.xml -users users.xls -out out.xml -import -server http:~/~/localhost:8080 -domain ddenterpriseapi -user admin -pass admi** | |
2.1 | 96 | * **java -jar importtools.jar -export -server http:~/~/localhost:8080 -domain ddenterpriseapi -user admin -pass admin** | |
97 | * **java -jar importtools.jar -export -exportfile "D:\my_users_export.csv" -server http:~/~/localhost:8080 -domain ddenterpriseapi -loginForm -user admin -pass admin** | ||
98 | * **java -jar importtools.jar -removeall -server http:~/~/localhost:8080 -domain ddenterpriseapi -user admin -pass admin** | ||
99 | * **java -jar importtools.jar -removeall -attr "license_type" -regexp "extranet" -server http:~/~/localhost:8080 -domain ddenterpriseapi -user admin -pass admin** | ||
100 | * **java -jar importtools.jar -removeall -attr "uid" -regexp "toto1[0-9]*" -server http:~/~/localhost:8080 -domain ddenterpriseapi -user admin -pass admin** |