WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: dragon49 on August 13, 2014, 10:13:03 AM

Title: Finding the Master Browser on a network subnet
Post by: dragon49 on August 13, 2014, 10:13:03 AM
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?
Title: Re: Finding the Master Browser on a network subnet
Post by: Deana on August 13, 2014, 10:54:27 AM
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
Title: Re: Finding the Master Browser on a network subnet
Post by: td on August 13, 2014, 11:22:14 AM
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.
Title: Re: Finding the Master Browser on a network subnet
Post by: dragon49 on August 13, 2014, 12:25:18 PM
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!
Title: Re: Finding the Master Browser on a network subnet
Post by: td on August 13, 2014, 12:40:30 PM
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.