I administer users at a school and accidently forgot to add the AD profile-path for 200+ users. How do i add it using samba-tool using a shell-script ?"samba-tool user edit XYZ" requests manual editing, and I want to avoid doing this. Edgar
Rowland Penny
2024-May-27 10:20 UTC
[Samba] how do i modify AD user-attributes in batch-mode ?
On Mon, 27 May 2024 09:19:45 +0000 (UTC) E Kogler via samba <samba at lists.samba.org> wrote:> I administer users at a school and accidently forgot to add the AD > profile-path for 200+ users. How do i add it using samba-tool using a > shell-script ?"samba-tool user edit XYZ" requests manual editing, and > I want to avoid doing this. EdgarAre we talking about adding the 'profilePath' attribute to your users ? If so, then I don't think you can do this with samba-tool, but you could script around ldbmodify and use an ldif, something like this: echo "$DN changetype: modify add: profilePath profilePath: $PROFILE_PATH -" | ldbmodify -H ldap://dc1.samdom.example.com [ -U administrator --password=$PASSWORD ] [ --use-kerberos=required ] Where: '$DN' is the users full dn '$PROFILE_PATH' is the required path to the profile 'dc1.samdom.example.com' is the FQDN of the DC to do the change on You can either supply a user name & password to do the change or run kinit before running the script and then use kerberos. Rowland