At this point, it's likely that two things would help you most:
1) Letting us know what the goals of your code are
2) seeing if a .net newsgroup couldn't be more helpful.
I think it's still worthwhile to post the goals of the code. There're
enough programmers here to be helpful. For specifics around .net s.ds it
would be best to post to those newsgroups.
Post by A.M"MYCORP\JBegley"?
To answer the question: I wouldn't be concerned about the format of the user
id so much. In the case you show there, unless you have multiple domains,
you can assume the domain and use the samaccountname to search off of. To
be more precise, it would be something like:
(&(ojbectCategory=Person)(objectClass=User)(samaccountname=JBegley))
The objectClass=user portion is there so it won't have to search contacts as
well as user objects as Ulf previously pointed out. It's not needed for you
to succeed in your query necessarily, but it is best to be as precise as
possible to get the best results. Since samaccountname is unique in the
domain, it could be what you're after. If you have multiple domains, you'll
have to translate the NTLM style domain to LDAP domain context in order to
know where to execute the query. Something to consider.
Al
Post by A.MThank you for help.
LDAP://cn=Begley Jeoff,OU=Vendors and
Contractors,DC=canada,DC=mycorp,DC=com
It returns me the complete information about a user named "Begley Jeoff".
"MYCORP\JBegley"?
Thank you,
Alan
Post by Al MulnickYou can. You can increase logging on the DC that is being used to the
point that it tells you what query it is using. You could also just read
up on the LDAP syntax to figure out what you want to exactly. As for
testing, a far better LDAP query tool would be LDP or Softerra's ldap
browser.
That will show you the results of queries as you type them.
Typical query example would be looking for users with a first initial of 'a'
(&(objectCategory=Person)(givenName=a*))
You'll want to be familiar with the and'ing and or'ing of queries and
what the effect on your application can be. You'll also want to avoid
some queries while confining the queries to use indexed attributes
wherever possible. You can find a lot more information about ldap query
optimization on MSDN.
Does that help?
Post by A.MHi,
I am having some challenge to build LDAP query for my .NET application.
Is there any LDAP query builder that eases "LDAP://" style queries?
When I use "People Search" feature in Start Menu, and choose search
within Active Directory, I can find users that I need to fined, but the
tool doesn't show the LDAP query. Is there any way that I can spy on
"Find People" dialog box so see what is the LDAP query?
Any help would be appreciated,
Alan