What does HRESULT 20497 (S_ADS_ERRORSOCCURRED) mean?

 
Previous Next
WDSMCCLIENT_CATEGORY S_ADS_NOMORE_ROWS

S_ADS_ERRORSOCCURRED

S_ADS_ERRORSOCCURRED is a successful ADSI status with an important warning semantic: a directory search produced usable progress, but one or more errors occurred while the result was being assembled or enumerated. It must not be treated as the same terminal condition as S_ADS_NOMORE_ROWS.

Preserve partial results and inspect the search contract

  • Record the exact ADS_SEARCHPREF_INFO preferences passed to SetSearchPreference and check each preference status.
  • For attribute-scope queries, remember that results can span servers and ADSI can return this status when some requested data was not available for every row.
  • Do not discard rows already processed merely because the final GetNextRow result is this status; report the partial-result condition separately.

Microsoft documents a concrete case in which an attribute-scope query returns S_ADS_ERRORSOCCURRED instead of the normal end-of-row status when a server cannot return all requested data for all rows. In diagnostic code, log the base object, filter, requested columns, search preferences, and the row count already consumed. That evidence separates a partial distributed-search failure from an invalid filter or a client enumeration bug.

ADSI error codes · Attribute-scope searches · IDirectorySearch workflow


Looking for a different code? Search another status or error code.