JSI Tip 8619. How can I use the Browstat.exe support tool to return computer names, their O/S, and network roles in my workgroup or domain?
Jerold Schulman
October 26, 2004
1 Min Read
When I run Browstat.exe, from SUPPORTTOOLSSUPTOOLS.MSI on the Windows CD-ROM, on my LAN, a typical output line might contain:
\JSI007 NT 05.02 (W,S,NT,SS,PBR,BBR,DFS) JSIINC.COM
Where:
\JSI007 is the computer name.NT is the computer's operating system.05.02 is the operating system version (Windows Server 2003).(W,S,NT,SS,PBR,BBR,DFS) are the BFLAGS, described by the following: 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 DSSJSIINC.COM is the srvcomment data value
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.
I have scripted BrowInfo.bat to return the computer name, O/S, Version, BFLAGS (without the open and close parenthesis), and srvcomment.
The syntax for using BrowInfo.bat is:
for /f "Tokens=1-4*" %%a in ('BrowInfo.bat') do ( set computer=%%a set OSN=%%b set OSV=%%c set BFLAGS=%%d set srvcmt=%%e call :DoSomething)
NOTE: BrowInfo.bat converts any " marks in srvcomment to ' and encloses the entire string in " marks. The ( and ) are removed from BFLAGS.
BrowInfo.bat contains:
@echo offsetlocal ENABLEDELAYEDEXPANSIONfor /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 if not {%%f}=={} set CMT=!CMT:"='! set FLG=%%e set FLG=!FLG:(=! set FLG=!FLG:^)=! @echo %%b %%c %%d !FLG! "!CMT!" ))endlocal
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like