Thursday, November 17, 2005

Some Useful Network Commands

The following are some useful DOS commands that helps you monitor your netwok:

1. net user -- List users on your machine
2. net user /domain -- Lists all the users on the domain. If no domain is specified after /domain switch then it will get all the users from the first directory of the forest.
3. net user /domain username -- Lists the entire active directory entry for the user username from the active directory.
4. net view -- Lists all the active machines on the domain.
5. net view \\machineName -- Lists all the shares on the machine specified. It is optional whether to use its dns name or IP address.
6. net use \\machineName\IPC$ "" /u:"" -- Connects to the Inter Process Communication Share IPC$ on the remote machine (machineName) with the built-in anonymous user. The connection can only be established if the NetBIOS protocol is enabled on the remote machine and port 139 is not blocked.
7. net stat -- List all the open ports on your machine and their status.
8. nbtstat -A ipAddress -- Dumps the NetBIOS table of the remote machine.
9. arp -A -- Lists all the entries of your MAC table and their types.
10. route -- With the help of this command you can modify the routing table i.e. add, modify or delete all the gateway entries. e.g. route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2 destination^ ^mask ^gateway metric^ ^Interface. If IF is not given, it tries to find the best interface for a given gateway.
11. route print -- Lists the routing table.

No comments: