This C# snippet lets you enumerate all the domain controllers in the current Active Directory Domain.
using System.DirectoryServices;using System.DirectoryServices.ActiveDirectory;
How To: Create User Accounts in Active Directory using C#
How to enumerate the Domains in the current Forest in C#
How To: Use Active Directory To Authenticate Users
The opinions expressed herein are my own personal opinions and do not represent
my employer's view in any way.