To search Active Directory by using LDP:
-
On the Browse menu, click Search.
The Search dialog box opens.
In the following searches, the LDAP directory is Active Directory. For user names, it contains a givenName attribute for first names, and an attribute of sn for last names.
-
To search for all users that have a first name of John and a last name of either Smith or Jones, type the following in the Filter field:
(&(objectClass=user)(givenName=John)(|(sn=Smith)(sn=Jones))))
-
To search for users that have a last name of Jones, but filter out those users that have a first name of John or Jane, and also filter out users that have not logged on at least 100 times, type the following in the Filter field. (The exclamation point (!) is the NOT operator.)
(&(objectClass=user)(sn=Jones)(!givenName=John)(!givenName=Jane)(!logonCount<=100))
Note
-
To search for reserved characters as part of an attribute value, you must precede the reserved character with an escape character. Use the following escape characters to represent the associated characters:
|
Character
|
Escape characters
|
|---|
* | 2a |
( | 28 |
) | 29 |
\ | 5c |
NUL | 00 |
-
To search for all of the users whose display names end in a close parenthesis character, type the following in the Filter field:
(&(objectClass=user)(displayName=*\29))
-
To search for all users who have a surname that starts with the letter J, type the following in the Filter field. (Queries support the wildcard character (*).)
(&(objectClass=user)(sn=j*))
-
To search for users whose home directories are G:\Accounting, type the following in the Filter field. (The attribute name is home-directory.)
(&(objectClass=user)(home-directory=G:\5cACCOUNTING*))
In this example, you use the Search Options dialog box to control which attributes are displayed in a search. Just a few attributes are displayed; the rest are filtered and do not display in the details window of LDP.
To control which attributes display:
-
In the Attributes input box, type the attributes to display:
"memberof;range:1-20"objectClass;objectGUID
Notes
-
Separate attributes with a semicolon. No spaces are necessary. All other attributes will be filtered out of the display.
-
A range is specified for the memberof attribute. Because a semicolon is used, the entire section must be separated from the rest of the attributes by quotation marks.
All searches display only the memberof, objectClass, and objectGUID attributes in the details pane. To return all attributes, replace any existing list of attributes with the wildcard character (*).