Click here to Skip to main content
15,066,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,

Can you please help me in retrieving all the computer names of the systems connected on LAN.

Many thanks

1 solution

If you use an Active Directory, you can query the computer names from AD. Have a look at this article Working with Active Directory in VB.NET[^]. Even though it's VB, the idea is easily understandable
Zoltán Zörgő 17-May-12 15:08pm
Even without knowing the real intentions of the questioner, this solution is only partial. In AD you can find only the computers (and some other devices) connected to the domain. There can be several other networked devices on a LAN you will not find in the AD. Assuming that you have an ethernet network, switches hold the most information about the devices the have encountered. Having the MAC addresses, you can try RARP to discover the IP, and if the device is in the DNS, you can retrieve it's name or get it with NetBios or WinS... if supported.
Wendelius 17-May-12 15:18pm
This is quite true. AD approach has limitations and using for example DnsQUery the results could be more complete. However if the OP wants computers recorded in AD I think querying AD would be the easiest way :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900