I am using a LDAP system to check the user cridential access control

string LDAPUserID = ConfigurationSettings.AppSettings["LDAPUSERID"];
                string LDAPPassword = ConfigurationSettings.AppSettings["LDAPUSERPASS"];
                string domainAndUsername = domain + @"\" + LDAPUserID;
                string CN = ConfigurationSettings.AppSettings["CN"];
                string SID = ConfigurationSettings.AppSettings["SID"];
                string MAIL = ConfigurationSettings.AppSettings["MAIL"];
                string SAMACCOUNTNAME = ConfigurationSettings.AppSettings["SAMACCOUNTNAME"];
                string SN = ConfigurationSettings.AppSettings["SN"];
                string CATEGORYTYPE = ConfigurationSettings.AppSettings["CATEGORYTYPE"];
                string memberOf = ConfigurationSettings.AppSettings["memberOf"];
                DirectoryEntry entry = new DirectoryEntry(LDAPpath, domainAndUsername, LDAPPassword);
                DirectorySearcher search = new DirectorySearcher(entry);
                string filterCriteria = string.Empty;
                filterCriteria = filterCriteria + "(" + SAMACCOUNTNAME + "=" + userId + ")";
                filterCriteria = "(&(objectCategory= " + CATEGORYTYPE + ")" + filterCriteria + ")";
                search.Filter = filterCriteria;
                search.PropertyNamesOnly = true;
                search.PropertiesToLoad.Add(CN);
                search.PropertiesToLoad.Add(SID);
                search.PropertiesToLoad.Add(SAMACCOUNTNAME);

                search.Sort.PropertyName = CN;
                search.Sort.Direction = SortDirection.Ascending;
                SearchResult result = search.FindOne();

Here in the search.FindOne() throws a com execption like
"The server is not operational"
The LDAP server is in different location.
I want to know that the error is due to LDAP server access or the firewall acess

Can any one have the solution for this

Thanks,
Sanbal

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.