tags:

views:

29

answers:

1

I want to search our Active Directory for the username: johndoe

I am unsure of what o and c is in this.

$sr=ldap_search($ds, "o=Staff, c=LDAP_DOMAIN_NAME", "uid=johndoe");

Is uid the appropriate parameter to search for a username within Active Directory? If not, what is the appropriate one.

I want to search thru the staff group, I think I put that in the appropriate place, as far as c, I am not sure if that is where the domain name goes, or the principal.

Any help is appreciated.

Any links to resources that can educate me more on what each paramter (o, c, cn, dn, etc...) mean, that would be greatly appreciated.

A: 

try this:

$sr=ldap_search($ds, "your base dsn here", "(&(&(o=Staff)(c=LDAP_DOMAIN_NAME))(uid=johndoe))");

I usually use these two sites as reference:

Lance Rushing
Thanks Lance, what is dsn referring to in "your base dsn here"?
Brad
I use "DC=atomic,DC=local" for my base dsn. (atomic is our network's domain name)
Lance Rushing