NMBLookup OS X Returning Inconsistant Results

- 1 answer

We're trying to get SMB volume listings in our OS X application, and have been using NMBLookup, as suggested by Apple, to get listings. However, more often than not, we're not able to get a full listing of available SMB volumes using the tool. We've got a good benchmark in that we can see the full listing the Apple Finder gets, and the majority of the time, our listing is not matching up, usually missing servers.

We're tried a number ways of executing the command, but haven't yet found anything that brings us back a complete listing.

nmblookup -M -- -

nmblookup '*'


Does anyone know what we could be doing wrong, or know of a better way to query for SMB volumes available on local subnets?



This work fairly well in our network. The point is to use smbclient -L on each of the entries returned by nmblookup:

nmblookup  -M -- - | grep -v querying | while read sw
echo $sw | awk -F' ' '{print $1}' | xargs smbclient -L 

Edit: @paul - now I see what you mean - a vista has just joined our network and the Finder shows it but not nmblookup, but smbclient shows it in the "Server" section.

smbclient has a "Server" section where it lists the machines found on the network. The command line I use is:

smbclient -L //the IP as returned by nmblookup of the master browser

cristi:~ diciu$ smbclient -L
Domain=[DOMAIN] OS=[Unix] Server=[Samba 3.0.24-7.fc5]
    Sharename       Type      Comment
    ---------       ----      -------
    internal        Disk      some share
Anonymous login successful
Domain=[DOMAIN] OS=[Unix] Server=[Samba 3.0.24-7.fc5]

    Server               Comment
    ---------            -------
    MMM                  Vista box not showing up in nmblookup