Web lists-archives.com

Re: [Samba] Scripting the next UID/GID number to use




On Tue, 29 May 2018 15:50:44 -0400
lingpanda101 via samba <samba@xxxxxxxxxxxxxxx> wrote:

> Hello,
> 
>      I'm developing a script to create a user and pass along all the 
> necessary unix attributes required. I'm successful except when I go
> to increment msSFU30MaxUidNumber or msSFU30MaxGidNumber. I'm not sure
> how to use ldbedit to script this process. Any guidance would be
> great. Thanks.
> 
> - James
> 
> 
> 

Something like this:

# UPDATE msSFU30MaxUidNumber/msSFU30MaxGidNumber
# Input : $1 $2
# $1: what to update (msSFU30MaxUidNumber or msSFU30MaxGidNumber)
# $2: Next Number
#
# Output : Nothing
_updatemax () {
echo "Updating $1"

newid="dn: CN=$domainNETBios,CN=ypservers,CN=ypServ30,CN=RpcServices,CN=System,$domainDN
changetype: modify
replace: $1
$1: $2"

echo "${newid}" | $LDBMODIFYBIN -H "$ldbdb" > /dev/null 2>&1
if [ $? != 0 ]; then
    echo "Error updating $1 in AD."
    exit 1
fi

echo "Successfully updated $1 in AD"
}

Rowland

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