How to get a list of all domains?
- by AngryHacker
I'm trying to get all domains that are available in the Windows Login dialog (in the Domain dropdown).
I've tried the following code but it only returns the domain I am logged into. Am I missing something?
StringCollection domainList = new StringCollection();
try
{
DirectoryEntry en = new DirectoryEntry("LDAP://");
// Search for…