Zentyal Forum, Linux Small Business Server

Zentyal Server => Email and Groupware => Topic started by: nontrivial on February 27, 2017, 11:31:15 pm

Title: [SOLVED] Importing users into Zentyal 5.0
Post by: nontrivial on February 27, 2017, 11:31:15 pm
Now that Zentyal is using samba to keep it's data, how you import users has changed. Here is a code snippet that illustrates the basics:

  #!/usr/bin/perl
  use EBox;
  use EBox::Samba::User;
  EBox::init();
  my $Parent = EBox::Samba::User->defaultContainer();
  for my $Item (@Items) {
    print("Adding user '$Item->{uid}'...\n");
    EBox::Samba::User->create(
      parent => $Parent,
      samAccountName => $Item->{uid},
      givenName => $Item->{givenname},
      sn => $Item->{surname},
      mail => $Item->{mail},
      password => $Item->{password}
      );
  }


There are other parameters but I haven't tried them:
 initials  (Middle name?)
 displayName
 description