Understanding Browstat.exe output.

  • Thread starter Thread starter Jerold Schulman
  • Start date Start date
J

Jerold Schulman

Using Browstat.exe from \SUPPORT\TOOLS\SUPTOOLS.MSI on the Windows CD-ROM (W2K, WXP, W2K3), I am writing a script
to parse the returned information for a domain or workgroup.

NOTE: In a single segment LAN, you can run Browstat.exe on any computer. If your LAN has multiple segments,
run it on the master browser.

On a small test domain, the following script returns:

@echo off
for /f "Tokens=2" %%a in ('browstat VIEW Transport^|find "\Device\"') do (
for /f "Tokens=*" %%b in ('browstat VIEW %%a^|findstr /L /B "\\"') do (
@echo %%b
)
)

\\JSITST1 NT 05.02 (W,S,PDC,TS,PQ,DL,NT,MBR,DFS) JSIINC PDC
\\JSITST5 NT 05.00 (W,S,NT,PBR)
\\JSITST7 NT 05.02 (W,S,NT,SS,PBR,BBR,DFS) "JSIINC.COM"
\\JSITST9 NT 05.01 (W,S,TS,PQ,NT,PBR) Dell Precision Workstation 650

The trailing information is from the SrvComment Value Name at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters.

As I don't have any DOS, Window 3.x, Windows95, Windows 98, Window Millenium, or non-Windows boxes,
could you run the above batch and let me know if the Operating System and Version are 1 or 2 fields?
Does Windows 98 return a version number?
How about a unix-based box?
Etc...?

If all clients return an O/S type and Version, my final script would be:

@echo off
setlocal ENABLEDELAYEDEXPANSION
for /f "Tokens=2" %%a in ('browstat VIEW Transport^|find "\Device\"') do (
for /f "Tokens=1-4*" %%b in ('browstat VIEW %%a^|findstr /L /B "\\"') do (
set CMT=%%f
set CMT=!CMT:"='!
set FLG=%%e
set FLG=!FLG:(=!
set FLG=!FLG:^)=!
@echo %%b %%c %%d !FLG! "!CMT!"
)
)
endlocal

returning:

\\ComputerName OSN OSV BFLAGS SrvComment

The Browstat.exe help indicates that
OSN and BFLAGS (separated by commas) are:
W Workstation service
S Server service
SQL SQLServer
PDC PrimaryDomainController
BDC BackupDomainController
TS TimeSource
AFP AFPServer
NV Novell
MBC MemberServer
PQ PrintServer
DL DialinServer
XN Xenix
NT Windows NT
WFW WindowsForWorkgroups
MFPN MS Netware
SS StandardServer
PBR PotentialBrowser
BBR BackupBrowser
MBR MasterBrowser
OSF OSFServer
VMS VMSServer
W95 Windows95
DFS DistributedFileSystem
CLUS NTCluster
DCE IBM DSS


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Back
Top