Finding the Master Browser on a network subnet

Started by dragon49, August 13, 2014, 10:13:03 AM

Previous topic - Next topic

dragon49

I am using an old version of Winbatchââ,¬â€2003J

With that version and the available extenders, it it possible to write a script that will return the name of the PC that is acting as the master browser for a subnet?

Deana

Check out the Win32 network extender function wntServerList.

Code (winbatch) Select
AddExtender('wwwnt34i.dll')
masterbrowserflag = 262144
masterbrowser = wntServerList("","",masterbrowserflag)
AskItemlist("wntServerList - Servers running the master browser service",masterbrowser,@TAB,@SORTED,@SINGLE)
Exit
Deana F.
Technical Support
Wilson WindowWare Inc.

td

The above script should give you the master browser for the current computer but it may be theoretically  possible to have more than one master browser in a subnet.  It depends on whether or not the computers on the subnet are joined to the same Windows network domain or work group. If all the NetBIOS computer in the subnet are also joined to a single Windows network domain/work group then you should, hopefully, get the  master browser for the subnet.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

dragon49

Thanks for the quick reply.  The above script actually returns all of the master browsers for all of the subnets on my domainââ,¬â€Which is fine and more than I asked for!

td

After giving it some thought, your results do make sense on a Windows Network domain based network as apposed to a workgroup network.

Thanx for reporting your results.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade