Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
The search in the preceding section is not limited to user account types in the Management OU. The name attributes of other objects, such as computers and OUs, are also found. To specify criteria to limit your search, you add one or more search filters to your query statement.
Tip
Listing 7.25 contains a script that uses LDAP search dialect to limit a result set to the value of an attribute assigned to a specific type of user account in an OU. To carry out this task, the script performs the following steps:
Lines 8 10 specify the search base, two search filters, the attribute to return, and the search scope.
The first search filter limits the query to all objects that are assigned the defaultObjectCategory of person. The objectCategory property of the LDAP search dialect maps to the defaultObjectCategory of an object s class.
The second search filter limits the query to all user account types whose objectClass attribute is user. Anything returned by the query must satisfy both filter conditions because the search filters are prefaced with the ampersand (&), which is the AND operator.
The query string returns records containing a single field, the name field.
Listing 7.25 Performing a Search to Display the Names of User Account Types That Are Security Principals in an OU
|
|
Send us your feedback | « Previous | Next » |