||Specifies that searches should be carried out asynchronously.
By default, searches are synchronous.
In a synchronous search, the GetFirstRow and
GetNextRow methods of IDirectorySearch do not return
until the server returns the entire result (or, for a paged search,
the entire page).
An asynchronous search blocks until one row of the search
results is available, or until the timeout interval specified by
the ADS_SEARCHPREF_TIMEOUT search preference elapses.
||Specifies that aliases of found objects are to be resolved. Use
one of the following ADS_DEREFENUM enumerations to specify how this
should be done.
||Does not dereference aliases when searching or locating the
base object of the search.
||Dereferences aliases when searching subordinates of the base
object, but not when locating the base itself.
||Dereferences aliases when locating the base object of the
search, but not when searching its subordinates.
||Dereferences aliases when both searching subordinates and
locating the base object of the search.
||Size limit the server should allow for a search. For Active
Directory, the size limit specifies the maximum number of returned
objects. The server stops searching once the size limit is reached
and returns the results accumulated up to that point.
||Time limit (in seconds) that the server should allow for the
search. When the time limit is reached, the server stops searching
and returns whatever results it has accumulated up to that
||Indicates that the search should obtain only the name of
attributes to which values have been assigned.
||Scope for the search. For the appropriate settings, see the
following ADS_SCOPEENUM enumeration values.
||Limits the search to the base object. The result contains at
most one object.
||Searches one level of the immediate children, excluding the
||Default. Searches the whole subtree, including all the children
and the base object itself.
||Time limit (in seconds) that a client waits for the server to
return the result. This option is set in an ADS_SEARCHPREF_INFO
||Page size in a paged search. For each request by the client,
the server returns at most the number of objects as set by the page
||Time limit (in seconds) that the server allows to search a page
of results (as opposed to the time limit for the entire search).
When the limit is reached, the server stops searching and returns
the result obtained up to that point, along with a cookie
containing the information about where to resume searching.
||Specifies that referrals can be chased. If the root search is
not specified in the naming context of the server or when the
search results cross a naming context (for example, when you have
child domains and search in the parent domain), the server sends a
referral message to the client which the client can choose to
ignore or chase. For more information on referrals chasing, see
||Specifies that the server sorts the result set. Use the
ADS_SORTKEY structure to specify the sort keys. This search
preference works only for directory servers that support the LDAP
control for server-side sorting. Active Directory supports the sort
control, but it can impact server performance, particularly if the
results set is large. Note that Active Directory supports only a
single sort key.
||Specifies if the result should be cached on the client side. By
default, ADSI caches the result set. Turning off this option may be
more desirable for large result sets.
||Specifies a directory synchronization (DirSync) search, which
returns all changes since a specified state. In the ADSVALUE
structure, set the dwType member to ADSTYPE_PROV_SPECIFIC.
The ProviderSpecific member is an ADS_PROV_SPECIFIC
structure whose lpValue member specifies a cookie that
indicates the state from which changes are retrieved. The first
time you use the DirSync control, set the dwLength and
lpValue members of the ADS_PROV_SPECIFIC structure to zero
and NULL respectively. After reading through the results set
returned by the search until IDirectorySearch::GetNextRow
returns S_ADS_NOMORE_ROWS, call IDirectorySearch::GetColumn
to retrieve the ADS_DIRSYNC_COOKIE attribute which contains a
cookie to use in the next DirSync search.
This flag cannot be combined with ADS_SEARCHPREF_PAGESIZE.
The caller must have the privilege.
||Specifies whether the search should also return deleted objects
that match the search filter. When objects are deleted, Active
Directory moves them to a "Deleted Objects" container. By default,
deleted objects are not included in the search results. In the
structure, set the dwType member to ADSTYPE_BOOLEAN. To
include deleted objects, set ADSVALUE.Boolean to TRUE.
Not all attributes are preserved when the object is deleted. You
can retrieve the objectGUID and RDN attributes. The
distinguishedName attribute is the DN of the object in the
"Deleted Objects" container, not the previous DN. The
isDeleted attribute is TRUE for a deleted object.
||Specifies that the search should use the LDAP virtual list view
(VLV) control. ADS_SEARCHPREF_VLV can be used to access both
string-type and offset-type VLV searches, by setting the
appropriate fields. These two options cannot be used
simultaneously, because it is not possible to set the VLV control
to request a result set that is both located at a specific offset
and follows a particular value in the sort sequence.
To perform a string search, set the lpszTarget field in
ADS_VLV to the string to be searched for. To perform an offset type
search, set the offset field in ADS_VLV. If you use an offset
search, you must set lpszTarget to NULL.
ADS_SEARCHPREF_SORT_ON must be set to TRUE when using
ADS_SEARCHPREF_VLV. The sort order of the search results determines
the order used for the VLV search. If performing an offset-type
search, the offset is used as an index into the sorted list. If
performing a string-type search, the server attempts to return the
first entry which is greater-than-or-equal-to the string, based on
the sort order.
Caching of search results is automatically disabled when
ADS_SEARCHPREF_VLV is specified.
If you assign ADS_SEARCHPREF_CACHE_RESULTS a TRUE value when
using ADS_SEARCHPREF_VLV, SetSearchPreference will fail with the
||Specifies that an attribute-scoped query search should be
performed. The search is performed against those objects named in a
specified attribute of the base object. This attribute, which must
be a DN-valued attribute, is specified in the ADSVALUE structure as
a CaseIgnoreString. Only one attribute may be specified.
Search scope is automatically set to ADS_SCOPE_BASE when using this
preference. Attempting to set the scope otherwise will fail with
the error E_ADS_BAD_PARAMETER. With the exception of the
ADS_SEARCHPREF_VLV preference, all other preferences that use LPAD
controls-such as ADS_SEARCHPREF_DIRSYNC, ADS_SEARCHPREF_TOMBSTONE,
and so on-are not allowed when this preference is specified.