Thank u Marc. i need to login to a NDS directory using a
username and password and to retrieve the attributes of
that user.
Try to bind to the user either by means of LDAP, or NDS - the two are
distinctly different providers, sometimes one works better than the
other:
DirectoryEntry deUser = new DirectoryEntry("LDAP://cn=John
Doe,cn=Users,dc=fabrikam,dc=com", "your user name", "your password");
// if the user credentials are invalid, your object will be null
if (deUser != null)
{
// access the user's attribute(s), checking for existence first
if (deUser.Properties.Contains("someattribute"))
{
if (deUser.Properties["someattribute"].Count > 0)
{
Console.WriteLine(deUser.Properties["someattribute"].Value.ToString();
}
}
}
So you need to know what your user is called, and where he resides
(which OU etc.).
Alternatively, you might get better results by using the NDS provider
- never used it myself from .NET, but it should work something like
this:
DirectoryEntry deUser = new
DirectoryEntry("NDS://MyNDSTree/O=MyOrg/OU=SomeOU/CN=John Doe", "your
user name", "your password");
Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch