I have a few Pis (Raspbian), a few Windows one other Linux PC on my LAN at home. They operate under two different workgroups set by the Windows computers. I'm playing around with the settings of Samba on my Pis. Let's say I didn't know, is there a terminal command or Bash script I can use to see what (just the names) workgroups are available on my network?

1 Answer 1


This is not a pi-specific question.

The easiest way is to use nbtscan:

nbtscan -v -h

Or just search for "samba find all netgroups" on Google!

  • Thank you. Was hoping for a cleaner and more specific solution, but it does give the required information. Commented Apr 16, 2016 at 16:27
  • 1
    I aimed for the least-effort and least-amount-of-understanding-necessary solution :) After you've played around with nbtscan and smbclient, you may want to look into the python-samba (or ruby-samba or whatever your choice of poison is :) ) libraries and do exactly what you need.
    – JayEye
    Commented Apr 16, 2016 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.