Le 08/11/2016 à 10:32, Braun, Thomas [Wekal] a écrit :

How do you get "$PivotValue"?

Define Columns,
my $csv_pivot_fields = $ENV{CSV_PIVOT_FIELDS} || "givenName,sn,o";

Push indexes into an Array while parsing the first Row

if ( grep( /^$attributes[$i]$/, @pivotCols ) ) … push (@pivotIndexes, $i);

Concat Values while parsing the Row

foreach ( @pivotIndexes ) { $PivotValules = $pivotValules . $columns[$_]; }

Translate Umlauts and trim it to only contain a-zA-Z0-9

$PivotValue = $PivotValules;

my %umlaute = ("ä" => "ae", "Ä" => "Ae", "ü" => "ue", "Ü" => "Ue", "ö" => "oe", "Ö" => "Oe", "ß" => "ss" );

my $umlautkeys = join ("|", keys(%umlaute));

$PivotValue =~ s/($umlautkeys)/$umlaute{$1}/g;

$PivotValue =~ tr/a-zA-Z0-9//cd;

I do this to have a every time unique Key for a Person in a Company.

Like you see in my Console Output of the perlscripts running standalone, this contains spaces only after : and ,

And this Output ist generated by print $entry->ldif();

If I run your sample.csv and original Sample script, it generates it even the same way

./lsc-executable-csv2ldif-list.pl

dn: cn=line 2

uid: j.clarke

But you use CN and don’t use the full Path in the DN

dn: uid=GivennameSurnameCompany, ou=Contacts ,dc=my, dc=domain

uid: GivennameSurnameCompany

But when I leave the DN without the OU, I get the Entry Already ExistsError



Then you need to adapt the destination filters, in order to let LSC know how to find the target entry depending on your pivot attribute.


_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users

Reply via email to