Author Topic: New!! Bulk User import for Zentyal 4 with add to existing OU/Group function  (Read 13217 times)

julio

  • Guest
Re: Bulk User import for Zentyal 4 with add to existing Group function
« Reply #15 on: September 16, 2015, 09:51:01 pm »
Hello Julio,

Thanks for your work. Only two questions, your script puts all users on "default container", if I have an specific OU (for example students), how I have to do to change default container to "students" OU?

And if I need put some users in two groups, can I add more values in the script? Where I can look the possibles values for the script?

Regards,

i've modified the script and the users.csv structure, please test it!
« Last Edit: September 16, 2015, 10:05:03 pm by julio »

cstfff

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
There is any place where found a referece about the perl modules?

elphio

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
On a fresh installation (v 4.2) all up to date, only Domain Controller and File Sharing (and it's dipendencies) confugured, the script (with the users.csv in the example) give me the "Missing argument: parent" error.

Arif Ali

  • Zen Apprentice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
On a fresh installation (v 4.2) all up to date, only Domain Controller and File Sharing (and it's dipendencies) confugured, the script (with the users.csv in the example) give me the "Missing argument: parent" error.

I have just tried it and I had to make the following modification to get it working, try the change and see if that works

Code: [Select]
--- bulk_add_users.pl.orig      2016-08-28 23:38:05.240111912 +0100
+++ bulk_add_users.pl   2016-08-28 23:32:54.596560475 +0100
@@ -18,7 +18,7 @@
   chomp ($line);
   if (substr($line, 0, 1) ne '#') {
     my ($ou, $group, $username, $firstname, $lastname, $password, $description) = split(',', $line);
-    my $parent = $usersMod->objectFromDN("ou=$ou," . $usersMod->ldap->dn());
+    my $parent = $usersMod->objectFromDN("cn=$ou," . $usersMod->ldap->dn());
 
     my %user;
     $user{parent}         = $parent;

harshkukreja

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: New!! Bulk User import for Zentyal 4 with add to existing OU/Group function
« Reply #19 on: September 07, 2016, 12:00:28 pm »
Hi

I like to use the script for importing bulk users from the csv but I like to add the E-mail field also. Please help with the changes