You have to be running as a domain admin for that.
Use WMI scripts, connect in a loop to each server by IP address in the IP address range of your network, query the following entries in the registry:
for SQL 2005 servers to get a list of instances
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL
for SQL 2000 servers:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server
Value Name: InstalledInstances
if the above entries don't exist, then SQL Server 2000 or 2005 is not running on this computer. Load a list into the file or a table. Adter that you may be using OSQL, ADO.NET or OPENROWSET to query the list of databases.