Author Topic: [SOLVED] Importing users into Zentyal 5.0  (Read 1007 times)

nontrivial

  • Zen Warrior
  • ***
  • Posts: 181
  • Karma: +16/-0
    • View Profile
[SOLVED] Importing users into Zentyal 5.0
« 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