Here’s a little problem that drove me crazy: How do you determine the Master Browser in a Windows Workgroup?
First of all, lemme explain a bit about how a workgroup works. When you have a LAN set up running Windows machines, each machine can see all the others in Network Neighborhood (or just “Network” in Vista). If you want to see the files on another machine, you just go to Network Neighborhood, click, et voila!
The other method you can use is to open Windows Explorer (keyboard shortcut: Win-E) and in the location/address bar, type:
\\COMPUTER-NAME
So, if you want to go to the computer called BALTHAZAR, you’d type:
\\BALTHAZAR
And hit enter. This is handy to know if Network Neighborhood is not working. And a grumpy Network Neighborhood is exactly the reason why sometimes, you need to find out which computer is the Master Browser.
On a local area network (LAN), each computer “talks” to the others. Each computer has an IP address, like 192.168.0.27, and also a name. The name is what you call your computer so you and your friends don’t have to remember the IP address. In our example above, the computer name is BALTHAZAR, but the IP address might be 192.168.0.27. Fabulous.
[ad name=”square-r”] So, what happens is that each computer on the LAN must talk to the others. Since we’re only dealing with a workgroup, and there is no domain server, there is no computer to keep track of what machines are active on the network. This is where the Master Browser schtick comes into play.
What happens is that all the computers on your LAN hold an “election”. This election depends on a number of factors, but for the purposes of this discussion, we just have to know that all the computers get together and vote on who will be the Master Browser on the LAN. Once a computer is elected, it will keep track of what machines are connected to the LAN by more or less sending messages to say, “Yo! You still there?”
Of course, you may ask: What happens when the computer that is the Master Browser gets shut down when, say, I go to bed? In that case, you will find that your Network Neighborhood may not work so well. At that point, all the computers on the LAN get together again and they hold another election. As I understand it, there are one or more “Backup Master Browsers” waiting in the wings, but we’ll ignore that for now.
Now, what happens when you have Network Neighborhood turning up blank on you sporadically, or possibly missing several of the computers on your LAN from time to time? Well, in that case, you need to determine who is the Master Browser so that you can narrow down the problem to one computer and see if maybe you need an updated ethernet driver, or there are firewall problems, or whatever.
The “fun” way of doing this is with DOS commands. Here’s how you’d do it:
- Open up a command prompt
- Type
net view
and hit enter - Look at the list of computer names. These are the computers on your LAN. Note that the format is
\\COMPUTER-NAME
like I talked about above. - For each name in the list, type the following command:
nbtstat -a COMPUTER-NAME
One of the results from the nbtstat
commands will show a row with “_MSBROWSE_” in it. That means that this computer is the Master Browser.
Wasn’t that fun?
No, it wasn’t.
So, I wrote a little script in Ruby to do this for you. I needed to in order to troubleshoot a networking problem on one machine on my LAN, and I didn’t want to type 10-20 commands every time. But as long as I was writing it, I figured I would jack it up a bit. Here’s what it does:
net view
net view /domain
to determine the list of workgroup namesnet view /domain:[WORKGROUP]
to determine the list of puter names for each [WORKGROUP]- extracts the individual computer names and sticks them in an array
- iterates through the array and calls
ping -n 1 -4 COMPUTER-NAME
on each computer name (we only want to display IPv4 addresses, hence the “-4” switch) - iterates through the array of IP addresses and calls
nbtstat -A IP-ADDRESS
(the “-A” means “I’m giving you an IP address instead of a computer name”. This is a more reliable way of doing things.) - After each call to
nbtstat
, it not only checks for the _MSBROWSE_ string, but it also records the MAC address of the network adapter in the remote computer. - iterates through all the data and displays a nicely formatted table, like so:
Scanning LAN...
BERT 192.168.0.102 00-18-C0-42-A3-B2 CHEESE
BIGBUBBALOU 192.168.0.103 00-26-32-1F-72-ED WORKGROUP
RHINOX 192.168.0.101 00-00-00-00-00-00 WORKGROUP MASTER
Q 192.168.0.100 00-28-F6-68-F5-48 WORKGROUP
RADDAR 192.168.0.105 00-02-0D-74-FC-33 CHEESE
ANGELINA 192.168.0.106 00-B0-7E-C3-F7-A4 CHEESE
MOP 192.168.0.104 00-1B-8C-56-01-52 CHEESE MASTER
AI 192.168.0.107 00-6A-83-6B-A0-83 WORKGROUP
Press any key to exit...
I wrote this little script in Ruby because it was fast and easy. But I didn’t want to have to call it from a command prompt with ruby all the time, and I wanted others to be able to use it without having to install Ruby on their own computers. So, I compiled it into a self-contained executable using RubyScript2Exe, and I added a pretty icon with Resource Hacker. Now my nifty little 2kB script is a lovely 1.5MB executable. Well, ya know… You can’t have everything. It may be bloated, but at least it works!
You can run it from the command line, or from Windows. It’s best to put the file in your Windows directory. It won’t run properly unless it’s on your boot drive (usually C:). From version 1.6, it will run just fine even from a USB stick. If plopped into the Windows directory itself, it will be executable from any drive or directory on your computer. Anyway, if you run it from Windows, it will just open up a command prompt window and pause before closing it so you can see the results. On my machine, it’s nice and speedy.
Oh, and one last note: it might take 30 seconds or so to scan your LAN. The more machines you have, the more work it was to do.
So, now you have a lovely tool to determine the IP address, MAC address, name, and Master Browser status of all the computers on your LAN.
UPDATE (8 June 2009): My little LANscanner program has been updated to version 1.1. It now supports the x64 flavor of Windows XP, Vista, and 7. Be sure to read the included .TXT file for install instructions!
UPDATE (27 February 2010): LANscanner has been updated to version 1.2. New in this release is the display of the workgroup for each computer, as well as formatting improvements that should make the output easier to read even with long computer/workgroup names.
UPDATE (20 March 2010): LANscanner has been updated to version 1.3. This release is mostly a bug fix for 1.2. In the older version, the only workgroup reported was the one your puter was on. Oops! That didn’t make the feature very useful. Now LANscanner will first scan for all available workgroups, and accurately report all machines on all workgroups, including which puter is the Master Browser for each workgroup. I also optimized some code here and there for good measure.
UPDATE (23 December 2012): Thanks to some adventures by frank in bahia, there is one thing you will want to check if you have problems with LANscanner. As he wrote in his comment below:
Second only to “is the PC turned on” in the obvious fix category is “is Client for Microsoft Networks installed”.
What I’ll never understand is how those things UNinstall themselves!
To make sure Client for Microsoft Networks is installed:
- Open Network and Sharing Center
- Click “Change adapter settings”
- Right-click your ethernet adapter and choose Properties
- If “Client for Microsoft Networks” does not appear in the list of items, click the “Install…” button
- Choose “Client” for network feature you want to add, and then click the “Add…” button
- Find Microsoft’s “Client for Microsoft Networks” in the list, and click OK to install it
That should be about it. Of course, the procedure above varies a little depending on whether you’re using XP, Vista, Win 7, or Win 8, but that’s the gist of it. Thanks, frank!
UPDATE (27 January 2013): Thanks to dennis, it seems the System Error 53 is caused by workgroup and/or puter names with spaces in them. This has been fixed in v1.4. Also, LANscanner is now built using Ocra 1.3.0 and Ruby 1.9.3, since RubyScript2Exe is now rather outdated and nonfunctional. The executable is now 26% smaller.
UPDATE (04 May 2013): Version 1.5 of LANscanner is now available. Changes to this version:
- LANscanner now speaks Swedish, French, and English. If you’d like the program to work in your language, please e-mail me the output of the command: nbststat -A IPADDY, for any IPADDY on your LAN
- If MAC address is detected as 00-00-00-00-00-00, we now use “arp -a IPADDY” to overcome Samba problems and retrieve a valid MAC address
- All character encodings are now supported (at the expense of increased EXE file size, but oh well).
- To sort the output by IP addy instead of by puter name, pass any argument to LANScanner, like so: lanscan.exe ip
- Improved formatting for shorter IP addresses
Thanks to Mikael G for the “arp -a” tip!
UPDATE (07 May 2013): Version 1.51 is out. Added support for German and Polish Windows.
UPDATE (25 May 2013): Version 1.52 is out. Added support for the following command-line switches:
- -ip = sort output by IP address. Note that this has changed from the previous version!
- -w WORKGROUP = Scan only the workgroup called WORKGROUP
- -e WORKGROUP = Scan all workgroups except WORKGROUP
UPDATE (24 August 2013): Version 1.53 is out. Fixed -ip option so that IPs are properly numerically sorted.
UPDATE (11 November 2013): Version 1.54 is out. Added support for Spanish Windows.
UPDATE (27 April 2014): Version 1.55 is out. Added support for Norwegian Windows, plus the following command-line switches:
- -n = suppress the “Press any key to exit…” message at the end
- -m = Only display MASTER browsers found
UPDATE (22 October 2014): Version 1.56 is out. Added support for Portuguese, and changed to Ruby v2.0.0 + Ocra 1.3.3. Script is now bigger, but with Ruby 2 goodness!
UPDATE (17 December 2014): Version 1.57 is out. Added support for Japanese.
UPDATE (09 May 2015): Version 1.6 is out. Added support for running on any drive, not just the Windows installation drive. Will also run off a USB stick or any other drive – as long as Windows is installed on the puter.
UPDATE (27 November 2015): Windows 10 November Update (1511) breaks LANscanner! You’re probably getting: System Error 1231 has occurred. Microsoft is aware of the problem, and will hopefully release a fix soon. SIGH…
UPDATE (25 January 2016): Version 1.61 is out. Added support for Dutch. In Windows 10, supposedly an update that should be released in March will fix the System Error 1231 issue.
UPDATE (02 Feb 2016): Version 1.62 is out. Added support for Czech.
UPDATE (18 Feb 2016): Version 1.63 is out. Fixed detection of Windows drive.
UPDATE (2 Mar 2016): AT LAST! Latest 1 March updates for Windows 10 seem to have fixed the Samba issues that busted LANscanner. So, it finally works again!
UPDATE (1 May 2016): Version 1.64 is out. Fix for puters with multiple network adapters resulting in multiple/incorrect MAC addresses and Master Browser in output
UPDATE (22 May 2016): Version 1.64 has been rebuilt with Ocra 1.3.5. When built using the Ocra 1.3.6 gem, the resulting EXE was detected as malware by a number of antivirus solutions. Should be all better now!
UPDATE (21 Aug 2016): Version 1.65 is out. Fix for Win 10 where nbtstat no longer works to get local WORKGROUP, MSBROWSE status, or MAC addy; Getting IP from PuterName is more reliable and no longer results in entries with IP but no MAC or WORKGROUP after a puter is turned off
UPDATE (24 Aug 2016): Version 1.66 is out. Rebuilt in Ruby 2.0.0 to make it work on 32-bit Windows again, fixed bug introduced in 1.65 related to new “Get IP” function on XP
UPDATE (27 Aug 2016): Version 1.67 is out. Removed fancy IP detection since it broke things… Oops!
UPDATE (28 Oct 2016): Version 1.68 is out. Added option “-nodeip www.xxx.yyy.zzz” for specifying the IPv4 of the network adapter you want to scan from/for in the case of puters with multiple network adapters. Note that VirtualBox adds its own virtual network adapter, which counts as a 2nd adapter. If you have multiple network adapters and you do not use the -nodeip option, your results may be wonky!
UPDATE (30 Jan 2018): ** LAN Scanner no longer works on Windows 10 1709 and above. **
See here for more info:
Time to switch to a HomeGroup on Windows 10
UPDATE (27 Dec 2018): LAN Scanner works again on Windows 10. See here for version 2.0!
Looking to expand your network? Then check out TP-LINK’s networking equipment!
Hi Scottie!
I wish I had found this earlier, by the time I got here I already figured it out but it drove me crazy too. The only thing left to find is why the windows 7 laptop won’t accept that he is not the Local Master Browser when the XP machine in the workgroup is fired first.
Your script is coming handy in my research.
By the way I thought you were dead Scotty… must be a time traveling paradox!
Jean
@Jean Villeneuve
Hmm, that is strange. As I understand it, the Master Browser election process favors newer versions of Windows. So, even if the XP box is Master first, when the 7 machine fires up, he should eventually take over.
Unfortunately, these things don’t always work the way they are supposed to. On a Vista, XP, 7, and Linux local network, I had to actually set Samba up on the one Linux box to always be the Master Browser, and suddenly all networking problems went away on all machines.
Samba usually gives me nothing but grief, but this time it saved me!
Hi Scottie,
for some strange reason my first try to submit a comment faild…anyways, great tool!
I have a question regarding master browser on win7: is there a way to competely force a win7 computer to *not* become the master?
thanks and kind regards,
robert
You can try using regedt32 to set the following on the machine you do NOT want to become the Master Browser:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Browser\Parameters\ISDomainMaster = False
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Browser\Parameters\MaintainServerList = Auto
I haven’t tried this, but I think it should work for Win 7 as well as for XP and Vista. To set a machine to be the MB:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Browser\Parameters\ISDomainMaster = True
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Browser\Parameters\MaintainServerList = Yes
I’m not sure this works exactly the same way in 7, because the ISDomainMaster key is missing for me. When a Vista machine is master on a network with 7, things just don’t work very well, and it seems that Vista likes to fight with 7 for some reason – even though 7 should have priority for MB status. With a machine on a domain, it seems things get hairy and I’ve never had to deal with that particular situation.
Thanks for the hint…I’ve read about theses settings before, but since they are missing and most of the posts were talking about XP or even NT4 I thought it would be outdated.
Does the computer browser service play any role in this? Couldn’t it be as easy as just disabling this service?
Regards, Robert
As far as I know, the browser service is required for network browsing even if the machine is not the master browser.
Another thing I just found out: my domain notebook doesn’t even have the Parameters-key…while my win7 “homeserver” does but lacks the ISDomainMaster value…do you suggest also creating the other values (ServiceDLL and ServiceDllUnloadOnStop) on the notebook alongside with the ISDomainMaster and MaintainServerList values?
Thanks,
Robert
Hmm, that I don’t know. I’m not even sure if the ISDomainMaster value works in 7. There is a pretty severe lack of information on the net about Win 7 networking, at least as far as the MB is concerned. I would just have to play around with it and see if I could get it to work.
The Master Browser can be displayed using the BROWSTAT utility (not tested by me), it’s in the XP Resource Kit apparently – http://support.microsoft.com/kb/188305/en-us
The Master Browser can also be displayed with the Windows 2000 resource kit, using the BROWMON utility (tested OK).
Also, according to M$ the browser service should NOT be run on all machines – http://support.microsoft.com/kb/135404/en-us
Finally, if you’re trying to figure out why your Samba server lost a browser election – os level 255 in smb.conf is your friend.
I discovered a new toy today:
net view /domain
This will display the workgroups on your LAN. Then you can do:
net view /domain:MSHOME
for example to view all the machines on the MSHOME workgroup.
This has now been incorporated in LANscanner v1.3, which you can download above. IOW, you get accurate workgroup reporting along with which machine is the Master on which workgroup.
I have 3 pc on my lan. For test purposes I put 2 pc on MSHOME workgroup and one in MS workgroup. If I run net view /domain on one pc on MSHOME it lists both workgroups. If I do the same on MS pc lists MS only.
After a while (may be half hour) the MS pc lists again both (as the day before). Probably because the networking updates very slowly the state of its componente. This makes unuseful all the try to get all the pc on lan.
More over your tool fails with error 87 after net view command.
I tried your tool…gives me an error…
@RENATO
The MS/MSHOME problem does indeed sound like slow Windows networking. If the computers stay on all the time, everything works well. If one or more machines are turned off at night for example, then anything can happen. I also found that if one particular computer with Vista was the master browser on the workgroup, nothing worked. If an identical Vista machine was master instead, everything worked fine! Sometimes it doesn’t make much sense at all.
In any case, if LANscanner doesn’t detect a workgroup, or if there is a problem with a workgroup, the DOS commands called will simply echo the error to the command prompt window, and then it will carry on with scanning the next workgroup.
The “System error 87 has occurred. The parameter is incorrect” can be caused by a number of problems – for example, see Vista – Problem accessing network shares. It seems to be a more generic error message, and I’ve never encountered it while using LANscanner on any of my machines.
What OS(es) are you running LANscan.exe on? I test each revision on XP, Vista, and 7, both 32 and 64-bit. But I don’t have access to various network configurations, no Windows servers, etc… so my testing is not exactly thorough. Also, LANscanner assumes that you have a nice standard install with all the proper networking services running. It also assumes that you are running the tool on the hard drive where you have Windows installed.
Hope this helps!
@Scottie
My OS on 3 pc is Windows XP SB2 and SB3 (Italian language)
The following are the lines i get:
LANscanner v1.3 – ScottiesTech.Info
Scanning LAN…
NET VIEW..etc…
system error 87
PCPROF 192.168.0.4 MASTER
PC-X 192.168.0.2 MASTER
PC12-3456789012 192.168.0.3
Press any key to exit…
Can you post the exact output, with the “..etc..”?
@Scottie
It’s only showing the format of the NET VIEW command…it is like this:
———————————————————————–
LANscanner v1.3 – ScottiesTech.Info
Scanning LAN…
Sintassi del comando:
NET VIEW
[\\nomecomputer | /DOMAIN:[nomedominio]]
NET VIEW /NETWORK:NW [\\nomecomputer]
Errore di sistema 87.
Parametro non corretto.
PCPROF 192.168.0.4 MASTER
PC-X 192.168.0.2 MASTER
PC12-3456789012 192.168.0.3
Press any key to exit…
———————————————————————–
Hope you understand the few italian words. If you need help just ask me.
Thanks for your help.
@RENATO
What’s really weird is that it seems the “net view /domain:[workgroup]” command is failing, because “net view /domain” works fine when you type it in manually. Also, if “net view /domain” wasn’t working, you would get a much different error.
So, what happens if you type: “net view /domain:WORKGROUP” (or whatever you call your workgroup)?
I think this is where it’s failing, but I’m not sure why.
Also, what is the output when you type: “nbtstat -A 192.168.0.4” (or some other valid IP address on your network)?
The workgroup names are not being displayed, and it is from the output of “nbtstat” that LANscanner gets the workgroup name for each computer that it lists.
Hopefully the answers to these two questions will shed some light on the problem!
@Scottie
Here I am with the answers:
——————————————————————-
NET VIEW /DOMAIN
Dominio
——————————————————————-
MS
MSHOME
Esecuzione comando riuscita.
NET VIEW /DOMAIN:MS
Nome server Note
———————————————————
\\PCPROF PcXP-Professional
Esecuzione comando riuscita.
NET VIEW /DOMAIN:MSHOME
Nome server Note
—————————————————————-
\\PC-X
\\PC12-3456789012 PC
Esecuzione comando riuscita.
NBTSTAT -A 192.168.0.4
Connessione alla rete locale (LAN):
Indirizzo IP nodo: [192.168.0.2] ID ambito: []
Tabella dei nomi NetBIOS del computer remotO
Nome Tipo Stato
———————————————
PCPROF UNICO Registrato
MS GRUPPO Registrato
PCPROF UNICO Registrato
MS GRUPPO Registrato
MS UNICO Registrato
..__MSBROWSE__. GRUPPO Registrato
Indirizzo MAC = 00-00-E2-44-D4-F8
———————————————————————–
LANscanner v1.3 – ScottiesTech.Info
Scanning LAN…
Sintassi del comando:
NET VIEW
[\\nomecomputer | /DOMAIN:[nomedominio]]
NET VIEW /NETWORK:NW [\\nomecomputer]
Errore di sistema 87.
Parametro non corretto.
PCPROF 192.168.0.4 MASTER
PC-X 192.168.0.3
PC12-3456789012 192.168.0.2 MASTER
Press any key to exit…
———————————————————————–
@RENATO
Oh dear, it’s pretty obvious now what the problem is: LANscanner was written for English Windows. So, when it tries to parse the output and call new commands, it screws everything up.
Unfortunately it doesn’t seem like it will be an easy fix since even the output of “nbtstat” appears to be different… there’s a whole column missing compared to the English version.
Maybe if I get Italian Windows some day, I’ll make LANscanner multilingual!
how can i output the results into a text file?
@tt
Click Start and type “cmd” and hit Enter to open a command prompt window.
Then just run it from the command line with “>” like so:
lanscan > output.txt
You’ll have to wait a few seconds, and then press Enter since it pauses at the end of the output for when you run it normally in Windows. If you put lanscan.exe in a system dir like C:\Windows, you can run it from anywhere. You can also include the path for the output file like so:
lanscan > C:\Users\Bubba\Desktop\output.txt
When the text file appears on your desktop, hit enter in the command prompt window to exit.
Scottie, thanks for the info and thank you for some good software. Much appreciated!!!
Is there any way to get this script to run across subnets without the use of a wins server?
I dunno. There isn’t any way that I know of, anyway!
Thanks for this nice tool to find the master browser.
Works fine on a Win XP in German (in ref to Renato’s post, March 23rd, 2010).
@Hans
… the tool shows the actual master browser (and probably some language specific error:
Systemfehler 87 aufgetreten.
Falscher Parameter.
However, the tool does reveal the current master browser.
When removing the master browser by simply turning it off, Windows Networking needs about one minute till a new Master browser has been elected.
Is there a way to influence this selection process?
Check out the links on this EggHeadCafe.com page. I’ve never tried it with Windows, but the Linux Samba option described further down the page does work quite nicely.
Scottie, (3 points follow: Thanks, browstat tool does not work for Win 7 implies need for your tool, possible error in your script for Win 7 (64bit):
1) Thanks for a great tool!
2) More people may be looking for your tool now that Win 7 is gaining popularlity. Background: I had a problem when I installed a new Linksys router that had the capability of a disk drive via USB port. Every time I turned off my Windows Home Server (WHS) I would have problems with the network. After alot of research I found out about the Network Browser and a popular tool call browstat. I found my problem was that the router had enough intelligence to be elected as the master browser but not enough to do the job of the master browser. So every time I reboot the WHS I must reboot the router to force the “election” back to the server.
Browstat has worked fine with Windows XP and Vista, BUT not with Win 7. In Win 7, running browstat gets the message “The procedure entry point I_NetNameValidate could not be located in the dynamic link library NETAPI32.dll”. I found a link on the internet that stated that Win 7 does not support that entry point hence browstat will not work for Win 7. Anyone using browstat to check on the master browser will be out of luck until they find your tool, which does work with Win 7.
3. Possible error in your script with Win 7 (64 bit): When I run your script on an XP computer (Galactica) I get:
ANDROMEDA 192.168.1.119 00-1F-3B-A6-EF-67 BLAIRGROUP
ATLANTIS 192.168.1.114 00-27-0E-0A-58-1F BLAIRGROUP MASTER
DAEDALUS 192.168.1.120 00-26-C7-51-0B-F6 BLAIRGROUP
DEEPSPACE 192.168.1.1 00-00-00-00-00-00 BLAIRGROUP
DESTINY 192.168.1.121 00-25-D3-68-52-23 BLAIRGROUP
ENTERPRISE 192.168.1.147 00-1C-C0-68-83-FC BLAIRGROUP
GALACTICA 192.168.1.115 00-24-7E-15-34-8F BLAIRGROUP
Notice Altantis is my WHS and DeepSpace is my Linksys router.
When I run the script from my Win 7 (64bit) computer (Daedalus) I get:
ANDROMEDA 192.168.1.119 00-1F-3B-A6-EF-67 BLAIRGROUP
ATLANTIS 192.168.1.114 00-1F-3B-A6-EF-67 BLAIRGROUP MASTER
DAEDALUS 192.168.1.113 00-27-0E-0A-58-1F BLAIRGROUP MASTER
DEEPSPACE 192.168.1.1 00-27-0E-0A-58-1F BLAIRGROUP
DESTINY 192.168.1.121 5C-FF-35-0B-09-F2 BLAIRGROUP
ENTERPRISE 192.168.1.147 5C-FF-35-0B-09-F2 BLAIRGROUP
GALACTICA 192.168.1.115 00-00-00-00-00-00 BLAIRGROUP
Notice the duplicate MAC addresses, two Masters, and one computer with zeros as MAC address. Nbtstat does not show Daedalus as a browser.
Let me know if this is a script error or if I need to do something different on my end.
Thanks again for your effort in this great script. I will be sharing it with others.
Jim
Hmm… I run Win 7 x64 on a LAN with Win 7 32-bit, Win 7 x64, Ubuntu, and XP 32-bit. The Ubuntu machine is set as the MB all the time, no matter what. The reason for this was that I noticed that if I allowed the Win machines to manage things, there were always problems. Same with Vista. Sometimes, one machine would be on all the time, and so it would be elected the MB. Problem was that that particular machine – for reasons I was never able to figure out – wouldn’t register certain other machines when it was the MB!! That was annoying.
Is DAEDALUS you’re only Win 7 x64 machine, or are there others? What OS are DESTINY and ENTERPRISE running (the ones with the same MAC address as reported by DAEDALUS)?
As for the 00 MAC address for your router, that seems to be normal. For some reason, linux boxes and routers generally won’t report their MAC address to LANscanner. I suspect this is because they don’t fully play nice with MS’s networking tools since they are using some form of Samba.
I suspect that WHS is doing something funky, but alas I’ve never used it before! I suppose it is possible there is some bug in LANscanner, but I haven’t ever experienced your results when using it myself, and I haven’t received any other similar reports. It’s really kind of sad, but my #1 recommendation is allow some implementation of Samba (in a router or on a linux box) to be the domain master with a super-high “OS level” rating.
I don’t know if you need your WHS to be the master, but usually Linksys routers are running a stripped down version of linux. On mine, there is a little URL trick you can do that enables SSH access, and then I can SSH in and modify settings. It’s possible you might be able to hack the Samba on your router to make it more “assertive” as the MB.
In the end, Windows networking is really handy, but the only I’ve found to make all the problems disappear is to use Samba to manage things! Crazy, but true. Then again, MS wants people to get a server to manage more than 10 computers, so that might explain things. Maybe they just don’t want it to work perfectly. But then, you have WHS! You might also try forcing Win 7 x64 to never be the MB, and see what happens then.
Thanks for such a useful utility! I discovered that the USB drive attached to my Netgear router was in a workgroup name that was different from the one I use for all the other computers and NAS devices on my network. I changed it with the admin tool for the router.
One of the NAS devices was assigned as the master browser. Not sure how it gets assigned (first device booted??), but it’s good to know which one is.
Scottie, (clarification on possible script error, which may relate to more than one network connection being active on the same machine – see details below)
Yes, Daedalus is my only 64 bit machine and only Win 7 machine. Andromeda is a Vista machine, Atlantis is a WHS, and all the rest are XP machines. If Linksys is running stripped down Linux, it would seem that is should be the last to be elected as the MB. However…
In any case, I have isolated the situation that causes the duplicate script entries on Daedalus. I can eliminate the problem or create it at will now. Daedalus (64bit Win7) is a laptop with both wireless and ethernet adapters. For some reason (yet to be determined) sometimes both connections to the network can be active at the same time yeilding a nbtstat status of:
_________________________________________
Local Area Connection:
Node IpAddress: [192.168.1.123] Scope Id: []
NetBIOS Remote Machine Name Table
Name Type Status
———————————————
DAEDALUS UNIQUE Registered
DAEDALUS UNIQUE Registered
BLAIRGROUP GROUP Registered
BLAIRGROUP GROUP Registered
MAC Address = 5C-FF-35-0B-09-F2
Bluetooth Network Connection:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
Wireless Network Connection:
Node IpAddress: [192.168.1.121] Scope Id: []
NetBIOS Remote Machine Name Table
Name Type Status
———————————————
DAEDALUS UNIQUE Registered
DAEDALUS UNIQUE Registered
BLAIRGROUP GROUP Registered
BLAIRGROUP GROUP Registered
MAC Address = 00-26-C7-51-0B-F6
Wireless Network Connection 2:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
_________________________________________
and hence the lanscan result of:
LANscanner v1.3 – ScottiesTech.Info
Scanning LAN…
ANDROMEDA 192.168.1.122 00-1F-3B-A6-EF-67 BLAIRGROUP
ATLANTIS 192.168.1.125 00-1F-3B-A6-EF-67 BLAIRGROUP MASTER
DAEDALUS 192.168.1.123 00-27-0E-0A-58-1F BLAIRGROUP MASTER
DEEPSPACE 192.168.1.1 00-27-0E-0A-58-1F BLAIRGROUP
DESTINY 192.168.1.118 5C-FF-35-0B-09-F2 BLAIRGROUP
ENTERPRISE 192.168.1.147 5C-FF-35-0B-09-F2 BLAIRGROUP
GALACTICA 192.168.1.124 00-00-00-00-00-00 BLAIRGROUP
At this point I can ping both network addresses from another machine even though ping to daedalus resolves to only one address.
If I turn off either the wireless adapter or the ethernet adapter (or unplug the cable) then lanscan works fine.
Much of the time Win 7 seems to automatically connect and disconnect so that only one network connection is active at one time, but sometimes (???) both are active. When both are active, I have no clue as to how the network activity is sorted out – immaterial regarding your script.
I do not know how common it is that more than one network connection is active at the same time, but if there is an error in your script it is relates to parsing the nbtstat output for the multiple connections
Send me an e-mail if you want more detail or want me to test any changes to the script. In the meantime, I know how to make it work correctly, and will be using your script to verify the MB.
Aha!
So, when both network connections are active, what do you get when you run:
nbtstat.exe -A [IP addy of DAEDALUS ethernet]
and
nbtstat.exe -A [IP addy of DAEDALUS WiFi]
I’m wondering because the way LANscanner works is:
1. Get domains/workgroups
2. Get puters on workgroup
3. Get IPs of puters in workgroup
4. Run nbtstat -A [IP] on each IP addy
So, if the ethernet and WiFi have different IPs (which they should, I would think…), then I’m not sure how ATLANTIS and DAEDALUS are being reported as the MB on the same workgroup. Unless somehow ATLANTIS and one of the network connections on DAEDALUS have the same IP, but that doesn’t make any sense.
Hmm…
Also, when both network connections are active on DAEDALUS, what’s the output of:
net view /domain:BLAIRGROUP
?
It would be great if the browstat familiar people could explain how to inflict “backup master browser” status on a machine other than the master browser so the master browser need not be powered to access shares on other LAN workstations [all xp pro for me]
I ran this from the desktop and got
“System error 53 has occured.
The network path was not found.”
2 W7 and 1 XP system are currently on the net but only the main W7 is showing on the main unit. all three are showing on the other two. I get the same error running it on the other systems.
update: I ran all the individual net view, nbtstat, ping, etc and it all works so what is wrong with the script? everything is showing on all systems now.
What’s the output when you do “net view /domain”?
What are the names of your 3 puters?
It might be some kind of string parsing error in the script, but it’s all pretty simple.
And – just in case – are you using US English Windows?
Please post the ruby script so those not on windows could modify it and use it too! Maybe it could become a github app, and we could fork it into two versions? Either way, I’d be interested in messing around with it if you don’t mind sharing in the spirit of open source.
I sent you an e-mail with the source. That was easier than posting it since I’m bit buried at the moment.
Let me know if you do anything exciting with it!
I am using your lanscan.exe v1.3 on my windows 7 Home Premium. We have 5 computers in one workgroup. I am having trouble seeing our NAS device. I copied lanscan.exe into C:\Windows. I ran it from the command prompt as Admin and also within Windows. It seems to not be working. How long should it take before I get the results back from the scan?
On my LAN, it returns results in about 2-3 seconds usually. When the scan doesn’t work, it usually means there is something weird going on with the LAN. For example, I recently had a problem where lanscan just totally crapped out and wouldn’t print anything. Problem was, Windows networking was also screwed up half the time. I eventually tracked the issue down to one computer that was temporarily using one of these 3G USB sticks to connect to the internet (when the main net was down one day). Those 3G sticks usually install a bunch of drivers and such, and in this case, there was some kind of virtual ethernet driver that had set itself up as the internet gateway for the whole LAN. It should have screwed up net access for everyone on the network, all the time – but it didn’t. It just acted like a black hole every now and then. When I disabled this wonky virtual ethernet driver, lanscan started working again, and so did Windows networking.
So, I’m afraid the solution is not always obvious, but I’d check for stuff like the above, as well as if the NAS gizmo isn’t doing something weird.
Hi Scottie,
when i run the script i get the “system error 6118 has occurred”. when i run the nbtstat command for each of my computer names I get a listing for the Name, Type, and Status. but nowhere does it show which computer is the master. under Type it states either “group” or “unique”, and under status, they just state “registered”. How can i find out which computer is the Master?
thanks, Dave
@davron94
See my comment above (#39). Every time I have seen that 6118 error, there was something on the network causing mayhem. Unfortunately, it’s a matter of trial and error to figure out what the problem is. It could be an actual physical device, or a network driver on one of the computers, or…?
@Scottie
So my issue is that i have 2 W7 Ultimate PC’s and a WD LIVE networked through a D-Link router. I share music and video files from the PC’s to the WD LIVE. Recently, the WD Live has not been able to connect with the network shares from the PC’s, but it still has internet access and in on the network. I was assuming that it had taken over the Master Browser position, and therefore, the other computers were not able to connect with it. I set a designated IP address on my router for the WD Live and that helped the problem somewhat. If the WD Live needs to be rebooted, I have to go through a whole process of booting and rebooting my other computers to get them all to connect again. I read somewhere that the Master Browser position can be permanently set to a specific computer and that normally the first computer turned on takes on that role normally. Any thoughts?
Thanks for your help!
Hmm… Well, I know there are registry hacks for Windows that people claim will make that machine the MB all the time, but they don’t seem to work. My guess is that the WD Live is running some flavor of linux. I have one on my home LAN, and I don’t have any problems – but, I also have a linux box that I configured (in /etc/samba/smb.conf) with:
That seems to have solved the problem in my case, although it isn’t bulletproof as I mentioned in a previous comment. I have also heard a few claims that certain broadband routers (which usually also run linux) can also cause problems sometimes, even if they aren’t actually doing any MB election stuff.
One last thing I can think of: in my WD TV Live, I turned OFF this option: Settings > Network Setting > Auto login to network share
That shouldn’t fix the MB problem, but it can help with connecting to other machines from the WD box. The auto login wouldn’t connect to my linux box, which has an open, guest-accessible directory shared. So, I typed either “guest/guest” “or guest/[blank]” for the L/P, and it started seeing the linux share and never asked me again.
Anyway, I dunno if any of this helps if you don’t have a linux box. I’m continually amazed that all this “plug and play” hardware can’t be designed to play nicely together.
I have two machines on my network. My XP machine is a desktop that is on all the time. I also have a windows 7 laptop that is set to hibernate. I have the master browser service disabled on the windows 7 machine to prevent any conflicts. I have recently had some trouble with the machines seeing each other. Several minutes ago the winows 7 machine suddenly showed up and I could access it. Now, several minutes later, without changing anything I can no longer access it. When I use your lanscan program the ping for that computer fails, although the name does show up. The icon for the computer also shows up in “My Network” but when I click on it I get “\\XPS is not accessible. You might not have permissions to use this network resource. Contact the administrator of this server to find out if you ghave access permissions. The network path was not found. I am able to successfully ping the windows 7 machine form the command pronpt using it’s IP address, but not it’s name. The windows 7 machine is on a wireless network. Any thoughts?
Thanks for your help.
I’m not sure the Computer Browser service is just used if that machine is the MB, or if it is also used to retrieve the list of machines on the network from another machine that is the MB. Mine is set to “Manual – Started” and my machine is never the MB. The only other thing I can think of is to check all your network settings.
Network and Sharing Center -> Advanced sharing settings
– Network discovery = On
– File and Printer Sharing = On
– Public folder sharing = On
– Password protected sharing = Off
That seemed to do it for me (at least so the XP boxes could see the Win 7 machines). Unfortunately, the only way I found to be super-certain that the network list is maintained all the time is to use a linux box that is on 24/7 and that insists on being the MB on the network. Letting Windows manage things seems to work okay if there are ALL XP machines or ALL Win 7 machines, and no weird linux-based devices like media servers/players, but any combination of the above results in network mayhem. It also seems that the more devices you have on a network, the less likely they will all play nicely together.
One other thing to try is even if you can’t see the machine in “Network” or “Network Neighborhood”, try the location = \\PUTERNAME thing in the file Explorer. That usually gets you there even if the machine list isn’t being updated properly. You can also map network drives that way and it should still work despite missing machines from Network.
Great tool….
I could only get it to work on my XP box though. Vista and Win 7 both gave me an error.
“A remote API error occurred/More help is available by typing NET HELPMSG2127”
never mind I did nto let it run long enough.
Thanks for this article. I had a situation wherein win7-64 could see the net but the 3 xp machines could not even access the workgroup. I followed your tutorial and it somehow forced win7 to accept that an xp machine had the master browser.
I DLed your utility and discovered that it, when run from any machine, returns my cable (or external) IP address on all machines but the host, which shows the LAN address. There is no indication of which is master, unless it’s run from the actual master browser machine.
In addition, the win7 command window closes without keyboard input at the end of the run. When run from an already open win7 command window(which is necessary to see the results), the following error is reported:
C:\Users\user1\eee\eee.lanscan.exe.2\app\lanscan.rb:120:
in “’: Permission denied – pause (Errno::EACCES)
from C:\Users\user1\eee\eee.lanscan.exe.2\app\lanscan.rb:120
from C:\Users\user1\eee\eee.lanscan.exe.2\bootstrap.rb:77:in `load’
from C:\Users\user1\eee\eee.lanscan.exe.2\bootstrap.rb:77
I’m using a hybrid wireless/wired net on a D-link router.
That’s pretty weird… I have Win 7, and either way when I run it, it works fine. I don’t even run it as an admin.
Just gave this a test on Win7-SP1 [Version 6.1.7601]:
Scanning LAN…
C:\Users\…\eee.lanscan.exe.2\app\lanscan.rb:77:in “’: No such file or directory
– nbtstat.exe -A 192.168.#.# (Errno::ENOENT)
from C:\Users\…\eee.lanscan.exe.2\app\lanscan.rb:77
from C:\Users\…\eee.lanscan.exe.2\app\lanscan.rb:67:in `each’
from C:\Users\…\eee.lanscan.exe.2\app\lanscan.rb:67
from C:\Users\…\eee.lanscan.exe.2\bootstrap.rb:77:in `load’
from C:\Users\…\eee.lanscan.exe.2\bootstrap.rb:77
(swapped out values for ‘…’ and ‘#’)
Huh. You’re the second person to report this. I don’t think it’s SP1, because that’s what I’m running and it works fine – on x86 and x64. Obviously, something is going on, but I can’t figure out what. Yet…
Same issue here – Win7 x64. c: is my windows partition.
D:\Users\user\eee\eee.lanscan.exe.2\app\lanscan.rb:77:in “’: No such file or
directory – nbtstat.exe -A 192.168.x.x (Errno::ENOENT)
from D:\Users\user\eee\eee.lanscan.exe.2\app\lanscan.rb:77
from D:\Users\user\eee\eee.lanscan.exe.2\app\lanscan.rb:67:in `each’
from D:\Users\user\eee\eee.lanscan.exe.2\app\lanscan.rb:67
from D:\Users\user\eee\eee.lanscan.exe.2\bootstrap.rb:77:in `load’
from D:\Users\user\eee\eee.lanscan.exe.2\bootstrap.rb:77
OH! I see the problem. Lanscan looks for nbtstat in the \\Windows directory. So, it must be run from your boot drive – C: in your case. I just put the executable in my C:\Windows dir, and then it will run from any drive.
Ahhhhh ha! Now it works. Thanks for the tip Scottie. Can you add a note or an update above?
Great! I added a little a note in the post itself.
Thanks for a great little tool. It solved one of my toughest problems managing our network.
Hey Scottie, interesting read. I’ve just encountered a problem. I was doing ssh to a router with port forwarding, worked just fine. I then installed a wireless printer on my network. Now my ssh doesn’t work, and the windows vista box (that I’m ssh’ing to) keeps giving me errors about master browser on another machine on my network every time I try and ssh. Could my router have become my master browser ? Could this cause traffic to my ssh box to be routed somewhere else ?? Having a tough time debugging this.
Hmm, I’m not sure what’s going on. The router shouldn’t be acting as MB at all, but I wouldn’t be surprised if the wireless printer was doing something crazy to screw stuff up. It never ceases to amaze me how poorly many networked gizmos are designed in terms of their ability to play nice with other devices and adhere to certain standards. But, other than that, I dunno. I would try removing the wireless printer, and trying again. If it starts working again, at least you know it’s the printer somehow.
Hi Scottie.
Hope you can help but maybe this is asking too much. Here is my problem. Like others I have situations where devices don’t show up in networking. I notices that LANSCAN seems to make them “appear” but that could just be happenstance. That’s not my big problem. My big problem is getting one of my W7 devices to see any of the XP devices.
So my network has a WHS with a groupname of WORKGROUP (because when I change it it seems to hang). All the other devices have a groupname of SMITH.
The devices consist of 4 XP/SP3, 1 Vista Home Premium, 3 W7 (1 Starter, 1 home Premium, 1 Ultimate).
So first of all on the XP machines I can see all the devices (most of the time). LANSCAN gets a System error 53 (device not connected) with a 2107 error message too. I think this is because there are devices that have gone to sleep that it can’t find any longer.
The issue is with the W7 Ultimate machine. It’s can’t see ANY XP devices, only Vista and W7 and LANSCAN shows nothing just error message 6118.
Any thoughts?
Hmm, I dunno… If I had to guess, I’d say that maybe WHS is doing something weird with the Master Browser stuff. Unfortunately, I don’t have WHS and have never played around with it. Of course, one way to figure out if WHS is the problem is to disconnect it from the network, wait a few minutes, and then try again with LANscanner. If it works, at least you know where the problem is. If not, rinse and repeat with the other puters.
That’s what I’d try, anyway!
Have a strange problem with my laptop. When I use LANscan, two of the machines on my home network show up with the IP address my ISP assigned to me instead of the 192.168.1.xx. Any idea why?
Thanks.
Weird… I’m afraid I have no idea.
Seems like it has something to do with Virtualbox. The problem goes away if I start virtualbox.
Oh, that might be because of VirtualBox’s crazy ethernet driver that it loads.
On my machine, LANscanner works REALLY, REALLY slowly if I have the “VirtualBox Host-Only Network” adapter enabled in Network & Sharing Center -> Change adapter settings.
Disabling the Vbox adapter doesn’t break Vbox at all, and then LANscanner works fine. Dunno why, though.
Nice app! I think I found a bug. When I run version 1.3 on our network, one PC has no MAC listed, and then two PCs have 00-00-00-00-00-00 listed as their MAC address. Let me know what I can do to help you resolve that. Thanks!
What OS(es) are all your PCs running?
Hi, I’ve been turning my hair-doo into a mohawk because of a networking issue! Would really like to get some advice.
The network runs off a Buffalo router. 4 computers and 1 NAS. Only one computer has an issue. (It can’t connect to the WD mybooklive NAS.)
I’ve simplified the network by turning off 2 of the computers.
Computer “JOHNS” has the issue. It’s running win xp 32 bit sp3.
Computer “ASI-JAMES” is fine. It’s running XP pro 64 bit (up to date)
The NAS is operating fine and accessible by computers 2, 3 &4.
NOTE: the other computers are #3 Vista laptop (no problem) and W7 64 bit laptop (no problems)
Here’s output from your program
LANscanner v1.3 – ScottiesTech.Info
Scanning LAN…
ASI-JAMESB 192.168.1.101 00-08-54-8E-DC-99 MSHOME
JOHNS 192.168.1.111 00-E0-18-ED-A0-B6 MSHOME MASTER
MYBOOKLIVE 192.168.1.148
Press any key to exit…
From “JOHNS” pinging “MYBOOKLIVE” fails. Pinging the router and “ASI-JAMESB” succeed. Mapping to it also fails. and using the WD install program to discover the NAS also fails.
From “ASI-JAMESB” (and the other computers) pinging “MYBOOKLIVE” succeeds. It can be mapped and the WD program discovered it just fine. Data can be written to and read from the NAS. In fact, the ASI-JAMESB computer can copy files from the JOHNS computer and write them onto the NAS.
Help!
Scottie, thanks for this script. I had to find a VM with 2000 on it to run browstat. Your script runs on my Win7x64 machine just fine, and helped me track down the master browser and eligible servers. A quick flush of the DNS on the master browser cleared up a lot of problems. Nice to know I can run this off my slightly more modern computer without having to dust off browstat.
Hello! I attempted to use your tool to figure out my network issue of NAS not showing up in explorer under network, but i received this error:
-System error 53 occurred
-The network path was not found.
I have W7 Ultimate, x64, windows installed on C drive and your EXE in the C drive. Also, right clicked and ran as administrator.
Thank you very much for this article! It helped me sort out a real pain.
A Win7 desktop PC I have at home kept dropping its LAN connection once a day, every day. Windows logs showed that a “forced election” (event ID 8033, source BROWSER) took place at that exact moment, so I tried everything from stopping services to hacking the registry to prevent that – all for naught.
I gave up when I thought there was nothing more I could try, but weeks later I came across this article and everything clicked into place.
As I ran the commands, I discovered that the desktop was in the Windows default WORKGROUP instead of my home workgroup (d’oh!!), and was the only machine and hence the master browser of that workgroup. Every night when the wired NAS – the master browser of the primary workgroup – shut down, the election happened with a slight delay, hence why I didn’t even suspect this.
At any rate, moving the PC into the primary workgroup stopped the forced elections and I couldn’t be happier. Thanks again!
@Jeff
Hi Jeff,
I had this issue as a side-effect of another problem I had. If you’re using workgroups, check that the PC and the NAS are in the same one, otherwise Windows won’t show the NAS in Network even if the PC can connect to the NAS just fine.
Hope this helps!