[Samba] how edit users via script

Anton Shevtsov shevtsovay at basealt.ru
Thu Jun 22 09:05:41 UTC 2023


22.06.2023 12:20, Rowland Penny via samba пишет:
>
>
> On 22/06/2023 07:59, Anton Shevtsov via samba wrote:
>> Hi,
>>
>> I am looking for any way to edit users non-interactively (script, 
>> stdin/stdout)
>>
>> samba-tool user edit username - not working with stdin.. i tried use 
>> --editor, but all attempts is failed
>>
>> It's impossible?
>>
>
> Hi Anton, perhaps if you showed us the commands you tried and told us 
> What OS and Samba version you are using.

[root at dc extend]# rpm -q samba
samba-4.16.10-alt1.x86_64

[root at dc extend]# cat /etc/os-release
NAME="ALT Server"
VERSION="10.1"
ID=altlinux
VERSION_ID=10.1
PRETTY_NAME="ALT Server 10.1 (Mendelevium)"
ANSI_COLOR="1;33"
CPE_NAME="cpe:/o:alt:server:10.1"
BUILD_ID="ALT Server 10.0"
HOME_URL="https://basealt.ru/"
BUG_REPORT_URL="https://bugs.altlinux.org/"

> I ask this because it is working for myself.
>
ok, how i can add , for example, 'department' attribute for all simpleuser*

for i in $(samba-tool user list | grep '^simpleuser'); do

samba-tool user edit $i | sed/awk/anythinghere ?

done



-- 
Anton



More information about the samba mailing list