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 1.2.3.4 -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 192.168.0.2 | awk '{print $NF}' | awk -F '.' '{print $1}'

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

Rowland

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