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?
This is not a pi-specific question.
The easiest way is to use nbtscan:
nbtscan -v -h 192.0.2.0/24
Or just search for "samba find all netgroups" on Google!