0

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

2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by __avd
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.