[Mono-dev] System.DirectoryServices error
dpenalba at codicesoftware.com
Tue Jan 31 11:49:06 EST 2006
Hello. I'm working with a LDAP server and I want to get a list of users. I have a ActiveDirectory Server in 192.168.1.3
I tried with the next code, It works on Windows systems.
public static void GetUsers()
ArrayList result = new ArrayList();
string rootPath = "LDAP://192.168.1.3";
DirectoryEntry root = new DirectoryEntry(rootPath);
DirectorySearcher searcher = new DirectorySearcher(root);
//The the computers are considered users by the active directory
searcher.Filter = "(&(!(objectClass=computer))(objectClass=user))";
SearchResultCollection allResults = searcher.FindAll();
foreach (SearchResult item in allResults)
if ( item != null )
ResultPropertyCollection properties = item.Properties;
Object o = properties["name"];
throw new Exception("There is no active directory in this server: " + e);
But on Linux systems (with mono) doesn't work.
Somebody can tell me how fix this.
The error obtained is the next:
Unhandled Exception: System.Exception: Error conecting with the LDAP server: LdapException: (32) No Such Object LdapException: Server Message: 000208D: NameErr: DSID-03100193, problem 2001 (NO_OBJECT), data 0, best match of: ' '
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list