internal static string GetConfigurationDomainControllerFqdn(string domainController) { if (string.IsNullOrEmpty(domainController)) { return(ADSession.GetCurrentConfigDCForLocalForest()); } Fqdn fqdn; if (!Fqdn.TryParse(domainController, out fqdn) || 0 >= domainController.IndexOf('.')) { domainController = Dns.GetHostEntry(domainController).HostName; } return(domainController); }