This can be quite complicated, depending on the network configuration. If it is only a Windows network and the account on which the application is running, as well as administrator rights, it will be a little easier.
The best way would be to request your PDC (Primary Domain Controller). Check the System.DirectoryServices.ActiveDirectory namespace.
If I remember correctly, you can use LDAP to query the domain controller - as long as the PDC is configured correctly! I found this LDAP query that can help you:
"(objectCategory = computer) (| (operating system = Windows Server *) (operating system = Windows 2000 server))))))
Of course, this will only be requested by Windows 2000 servers - you should be able to change as needed.
Check out the following links:
http://www.google.co.uk/search?gcx=c&sourceid=chrome&ie=UTF-8&q=c%23+ldap+query
source share