I have an administrative application that I would like to be able to “discover” Windows hosts on the same, or user-specified, subnet. What do you believe is the best way to quickly discover if a range of hosts are online, using Delphi?
I considered pinging the hosts (possibly using WMI and Delphi), but I believe there may be a more reliable way. I am concerned that clients may be configured to not respond to ping requests. Using nbtscan, I can very quickly get a list of Windows hosts on my subnet:
nbtscan 192.168.1.0/24
I’d like to be able to replicate this functionality, but I am not sure where to begin. Currently I am using the ICS component created by François Piette for Delphi 2010.
I welcome any suggestions.
After some digging, I found this project on Sourceforge that demonstrates how to perform a NetBios lookup on a single host using Indy components. I tested and this project works well with Delphi 2010. This could, of course, be modified to perform NetBios queries on a range of addresses.
NBLookup