Platform SDK: Active Directory, ADSI, and Directory Services

ADS_DEREFENUM

The ADS_DEREFENUM enumeration specifies the behavior in which aliases are dereferenced.

typedef enum {
  ADS_DEREF_NEVER        = 0,
  ADS_DEREF_SEARCHING    = 1,
  ADS_DEREF_FINDING      = 2,
  ADS_DEREF_ALWAYS       = 3
  } ADS_DEREFENUM;

Elements

ADS_DEREF_NEVER
Does not dereference aliases when searching or locating the base object of the search.
ADS_DEREF_SEARCHING
Dereferences aliases when searching subordinates of the base object, but not when locating the base itself.
ADS_DEREF_FINDING
Dereferences aliases when locating the base object of the search, but not when searching its subordinates.
ADS_DEREF_ALWAYS
Dereferences aliases when both searching subordinates and locating the base object of the search.

Remarks

The IDirectorySearch interface uses these constants to set the alias dereferencing behavior. If no option is specified, the server determines the default behavior.

Note  Because VBScript cannot read information from a type library, VBScript applications do not understand the symbolic constants as defined above. You should use the numerical constants instead to set the appropriate flags in your VBScript applications. If you want to use the symbolic constants as a good programming practice, you should make explicit declarations of such constants, as done here, in your VBScript applications.

Example Code [C++]

The following C++ code snippet illustrates how to set the search preference for alias dereferencing. m_pSearch refers to a pointer to an object implementing the IDirectorySearch interface.

ADS_SEARCHPREF_INFO prefInfo[1];
HRESULT hr;
 
prefInfo[0] = ADS_SEARCHPREF_DEREF_ALIASES;
prefInfo[0].vValue.dwType = ADSTYPE_INTEGER;
prefInfo[0].vValue.Integer = ADS_DEREF_ALWAYS;
hr = m_pSearch->SetSearchPreference(prefInfo, 1);

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
  Windows 95/98: Requires Windows 95 or later (with DSClient).
  Header: Declared in Iads.h.

See Also

ADSI Enumerations, IDirectorySearch