public static void GetComputers() { Domain domain = Domain.GetCurrentDomain(); var d = new ADDomain(domain.Name.ToString()); foreach (ADComputer c in d.GetADComputers()) { Console.WriteLine(c.GroupName + ", " + c.DistinguishedName); } }