Tool
I often need to modify or add a lot of users and I get the data from some system in cvs format. To quickly convert these data to ldif I wrote this tool. I've only tested it on Windows but it should work on Linux as well. Perl must be installed to make it work since this is a perl script. Type makeldif.pl -h to get help:
Usage: makeldif.pl -t <template> -a <attrib> [-o <output>] [-s <seperator>] [-h]
Options:
-t file Template file. This file is the template of the LDIF
code to be generated. Use *1..*n as variables to be replaces
from the attribute file.
-a file "Something"-separaded file with attributes to be replaced by the variables in the template. Ie.:
attrib.txt file
---------------
user1;locationA
template.ldif file
------------------
dn: cn=*1,ou=users,o=myorg
changetype: modify
replace: l
l: *2
This will generate:
dn: cn=user1,ou=users,o=myorg
changetype: modify
replace: l
l: locationA
-o file The file to write LDIF code to. If not specified it will be written to <STDOUT>.
-s sep The separator for the attribute file. If not specified ';' will be used. Use tab for \t (tabulator) and space for whitespace.
-h Prints this help text.
Ie.: makeldif.pl -t template.file -a attrib.file -o new.ldif -s tab
| Anhang | Größe |
|---|---|
| fmakeldif.zip | 1.79 KB |
Related Articles
User Comments
Use more than 10 variables
Submitted by TellierS on 7 September 2011 - 4:50am.
Code change to work with >10 variables (line 164):
(-> for ($j = $attribCount; $j >=0; $j--) {)
- Be the first to comment! To leave a comment you need to Login or Register


1