Tag Archives: nbtstat command

Nbstat

The Nbstat command is a great command to use when you need to display the NetBIOS over TCP/IP protocol statistics. The Nbstat command can also be used to display NetBIOS name tables for both local and remote computers. The Nbstat command can also be used to display the NetBIOS name cache, which will show you all of the NetBIOS names that have recently been associated with a specific IP address. When you use the -R and -RR attributes along with the Nbstat command you can refresh or purge the NetBIOS name cache (-R) and the names registered with WINS, Windows Internet Name Service, (-RR). The NetBIOS name cache helps to reduce network traffic by eliminate the need for broadcasting or long WINS queries.

Syntax (view syntax formatting guide):

nbstat[-aRemoteName][-AIPAddress][-c][-n][-r][-R][-RR][-s][-S][Interval]

Syntax Explanation:

  • -a RemoteName: Displays the NetBIOS name table of a remote computer, where RemoteName is the NetBIOS computer name of the remote computer. The NetBIOS name table is the list of NetBIOS names that corresponds to NetBIOS applications running on that computer.
  • -A IPAddress: Displays the NetBIOS name table of a remote computer, specified by the IP address (in dotted decimal notation) of the remote computer.
  • -c: Displays the contents of the NetBIOS name cache, the table of NetBIOS names and their resolved IP addresses.
  • -n: Displays the NetBIOS name table of the local computer. The status of Registered indicates that the name is registered either by broadcast or with a WINS server.
  • -r: Displays NetBIOS name resolution statistics. On a computer running Windows XP or a Windows Server 2003 operating system that is configured to use WINS, this parameter returns the number of names that have been resolved and registered using broadcast and WINS.
  • -R: Purges the contents of the NetBIOS name cache and then reloads the #PRE-tagged entries from the Lmhosts file.
  • -RR: Releases and then refreshes NetBIOS names for the local computer that is registered with WINS servers.
  • -s: Displays NetBIOS client and server sessions, attempting to convert the destination IP address to a name.
  • -S: Displays NetBIOS client and server sessions, listing the remote computers by destination IP address only.
  • Interval: Redisplays selected statistics, pausing the number of seconds specified in Interval between each display. Press CTRL+C to stop redisplaying statistics. If this parameter is omitted, nbtstat prints the current configuration information only once.
  • /?: Displays help at the command prompt.

The following list describes the column headings that are generated by nbtstat.

  • Input: The number of bytes received.
  • Output: The number of bytes sent.
  • In/Out: Whether the connection is from the computer (outbound) or from another computer to the local computer (inbound).
  • Life: The remaining time that a name table cache entry will live before it is purged.
  • Local Name: The local NetBIOS name associated with the connection.
  • Remote Host The name or IP address associated with the remote computer.
  • <03>: The last byte of a NetBIOS name converted to hexadecimal. Each NetBIOS name is 16 characters long. This last byte often has special significance because the same name might be present several times on a computer, differing only in the last byte. For example, <20> is a space in ASCII text.
  • Type: The type of name. A name can either be a unique name or a group name.
  • Status: Whether the NetBIOS service on the remote computer is running (Registered) or a duplicate computer name has registered the same service (Conflict).
  • State: The state of NetBIOS connections.

The following list describes the possible NetBIOS connection states.

  • Connected: A session has been established.
  • Associated: A connection endpoint has been created and associated with an IP address.
  • Listening: This endpoint is available for an inbound connection.
  • Idle: This endpoint has been opened but cannot receive connections.
  • Connecting: A session is in the connecting phase and the name-to-IP address mapping of the destination is being resolved.
  • Accepting: An inbound session is currently being accepted and will be connected shortly.
  • Reconnecting: A session is trying to reconnect (it failed to connect on the first attempt).
  • Outbound: A session is in the connecting phase and the TCP connection is currently being created.
  • Inbound: An inbound session is in the connecting phase.
  • Disconnecting: A session is in the process of disconnecting.
  • Disconnected: The local computer has issued a disconnect and it is waiting for confirmation from the remote system.

Explanation with Examples:

To display the NetBIOS name table of a remote computer with the NetBIOS name of COMPUTER190, execute:

nbtstat -a COMPUTER190

To display the NetBIOS name table of aremote computer withthe IP address of 192.168.10.12, execute:

nbtstat -A 192.168.10.12

To display the NetBIOS name table of the local machine, execute:

nbtstat -n

To display the contents of the local computer NetBIOS name cache, execute:

nbtstat -c

To purge the NetBIOS name cache and reload the #PRE-tagged entries in the local Lmhosts file, execute:

nbtstat -R

To display NetBIOS session statistics by IP address every 10 seconds, execute:

nbtstat -S 10