Web lists-archives.com

Re: [Samba] ldb*, -H, multiple source?

On Tue, 14 Nov 2017 17:31:15 +0100
Marco Gaiarin via samba <samba@xxxxxxxxxxxxxxx> wrote:

> There's some sintyax available to use, with ldb* tools, multiple
> ''server'', eg use multiple '-H', or write server in a roud-robin
> style?
> Thanks.

No, there is no way built into samba-tool to do what you are asking,
you will have to script something around samba-tool, something like


### Get DNS domain
DNSDOMAIN=$(hostname -d)
# Find DCs FQDN
DCS=$(host -t SRV "_ldap._tcp.${DNSDOMAIN}." | awk '{print $NF}')
# Exit if no DCs found
if [ -z "${DCS}" ]; then
    echo "Could not find an AD DC."
    exit 1
# Use whichever DC is found first
DC=$(echo "$DCS" | head -n 1)
# This removes the trailing dot

echo "Use this DC: $DC"

exit 0


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