Web lists-archives.com

Re: [Samba] Modify email entry on AD users

On Mon, 26 Feb 2018 12:25:37 -0300
Elias Pereira via samba <samba@xxxxxxxxxxxxxxx> wrote:

> Hello,
> I have about 1000 users who are without the email attribute and would
> like to update this.
> Via "samba-tool user edit" is it possible? If so, any examples?

By its very nature, 'samba-tool user edit' is meant to be used on a
user by user basis and more importantly, interactively, so no, I don't
think this will work.

> Via "ldapmodify" I believe that it is possible?! How can I do this
> directly in a command?

Your best bet is to write a script around ldbmodify. You could store
the usernames and their email addresses in a file. Read the file, line
by line, find the users DN with ldbsearch, then create an ldif similar
to this:

changetype: modify
add: mail

Add the ldif with ldbmodify, rinse & repeat for the next user ;-)


To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba