What does HRESULT 0x80005008 (E_ADS_BAD_PARAMETER) mean?

 
Previous Next
E_ADS_PROPERTY_INVALID E_ADS_OBJECT_UNBOUND

E_ADS_BAD_PARAMETER

E_ADS_BAD_PARAMETER is an interface-level validation failure. It is commonly more useful to inspect the complete argument set than to focus on the directory object itself, because individually valid values can form an invalid combination.

Validate argument combinations, not only null pointers

  • Log the method name and every search preference or flag supplied in the failing call.
  • Check the ADSTYPE stored in each ADS_SEARCHPREF_INFO.vValue against the preference being set.
  • For attribute-scope queries, do not force a non-base search scope; Microsoft documents that this combination causes SetSearchPreference to fail.

The attribute-scope query contract provides a concrete example: the queried attribute must be DN-valued and the search scope must be ADS_SCOPE_BASE. That illustrates why retrying with the same parameters is ineffective. In C/C++ diagnostics, dump structure sizes, enum values, and VARIANT/ADSTYPE tags before the COM call. If the failure follows a configuration change, compare the full preference list with a known-good request.

Generic ADSI errors · Attribute-scope query contract · Searching with IDirectorySearch


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