/// <summary> /// This will read in the ADServer value from the web.config and will return it /// as an LDAP path ie DC=creditsights, DC=cyberelves, DC=com. /// This is required when creating directoryentry other than the root. /// </summary> /// <returns></returns> private static string GetLDAPDomain() { StringBuilder LDAPDomain = new StringBuilder(); string[] LDAPDC = ADServer.Split('.'); for (int i = 0; i < LDAPDC.GetUpperBound(0) + 1; i++) { LDAPDomain.Append("DC=" + LDAPDC[i]); if (i < LDAPDC.GetUpperBound(0)) { LDAPDomain.Append(","); } } return(LDAPDomain.ToString()); }