Web lists-archives.com

Re: [Samba] any reliable way to discover Windows hostname over SMB2+?

On Thu, 13 Jul 2017 11:04:30 -0500
Andrew Walker via samba <samba@xxxxxxxxxxxxxxx> wrote:

> I forgot to mention in the previous email that smbclient works over
> SMB2. You just have increase the max protocol by adding the flag "-m
> SMB2".
> I.e. "smbclient -m SMB2 -L -N -d10 2>&1|grep AvNbComputerName"
> rpcclient is potentially a more efficient way to get this information.

I take it as you are talking about smbclient, this is on a Unix
machine, so how about:

host -i | awk '{print $NF}' | awk -F '.' '{print $1}'

If you want the FQDN, just remove the last part.


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