Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
The Filter and Hints properties of IADsContainer allow limiting the number of objects returned by enumeration. The filter property is similar to the search filters discussed earlier in "Searching Active Directory for User Accounts." Unlike search filters, the Filter property of IADsContainer requires the client to filter objects rather than the server. The Hints property is equivalent to the attributes requested in a search query. For example, you can use the Hints property to instruct IADsContainer to return only the cn or the ADsPath of an object.
IADsContainer also provides methods, including Create, MoveHere, and Delete (discussed earlier in this chapter), which can be used to perform account management tasks on enumerated objects.
Because IADsContainer enumeration loads all objects from a container into the local property cache, using enumeration for a large number of objects can affect client performance. Therefore, to retrieve the contents of a container with many objects, use the ADO OLEDB provider to perform a search.
Listing 7.34 contains a script that enumerates a container and then modifies an attribute in user account objects. To carry out this task, the script performs the following steps:
Contact account types are not returned by this filter.
Listing 7.34 Modifying Multiple User Accounts in a Container by Using Enumeration
|
|
Send us your feedback | « Previous | Next » |