LDAP

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
 
W

Willy Denoyette [MVP]

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
 
M

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
 
M

Marc Scheuner [MVP ADSI]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top