LDAP

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi,

I am trying to bind to an Active Directory server using the following snippet, but I always get a usre unknown or bad password error message.
DirectoryEntry de = new DirectoryEntry(LDAP://srv-dell.waysoft.local);
de.AuthenticationType = AuthenticationTypes.ServerBind;
de.Username = "administrator";
de.Password = "password";
string usr = de.Properties["DisplayName"].Value.ToString(); // the error message appears here

Any idea of what is wrong?

Thanks.
Mike
 
As the message says, it means the user credentials are unknown.
You specified administrator as UserName, but this is a local administrator account, you need to specify a domain admin account.

Willy.


Hi,

I am trying to bind to an Active Directory server using the following snippet, but I always get a usre unknown or bad password error message.
DirectoryEntry de = new DirectoryEntry(LDAP://srv-dell.waysoft.local);
de.AuthenticationType = AuthenticationTypes.ServerBind;
de.Username = "administrator";
de.Password = "password";
string usr = de.Properties["DisplayName"].Value.ToString(); // the error message appears here

Any idea of what is wrong?

Thanks.
Mike
 
Thanks Willy. I can now see the various properties. Is there a possibility to query the Active Directory to gather some information about the user (group, phone, etc.)? How can I do that?

Thanks.
Mike


As the message says, it means the user credentials are unknown.
You specified administrator as UserName, but this is a local administrator account, you need to specify a domain admin account.

Willy.


Hi,

I am trying to bind to an Active Directory server using the following snippet, but I always get a usre unknown or bad password error message.
DirectoryEntry de = new DirectoryEntry(LDAP://srv-dell.waysoft.local);
de.AuthenticationType = AuthenticationTypes.ServerBind;
de.Username = "administrator";
de.Password = "password";
string usr = de.Properties["DisplayName"].Value.ToString(); // the error message appears here

Any idea of what is wrong?

Thanks.
Mike
 
Thanks Willy. I can now see the various properties.
Is there a possibility to query the Active Directory to gather some information about the user (group, phone, etc.)? How can I do that?

Yes, of course - if you know what you're looking for, you can get
almost everything from AD ! ;-)

To get an understanding of the available properties etc., you can
either study the LDAP schema, or use something like my BeaverTail ADSI
browser to explore your objects.

BeaverTail is written in C#, available free of charge including source
code, from this link:

http://adsi.mvps.org/adsi/CSharp/beavertail.html

Enjoy!
Marc
 
Back
Top