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 domai
Add a reference to System.DirectoryServices.dll
using (var forest = Forest.GetCurrentForest()) { foreach (Domain domain in forest.Domains) { Debug.WriteLine(domain.Name); domain.Dispose(); } }