Directory Services

ADS_DEREFENUM

The ADS_DEREFENUM enumeration specifies the process through which aliases are dereferenced.

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

Values

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 defaults to ADS_DEREF_NEVER.

Note  The NDS system provider only supports ADS_DEREF_NEVER and ADS_DEREF_ALWAYS.

Note  Because VBScript cannot read data from a type library, VBScript applications do not recognize the symbolic constants as defined above. Use the numerical constants, instead, to set the appropriate flags in your VBScript applications. To use the symbolic constants, as a good programming practice, explicitly declare constants, as done here.

Example Code [C++]

The following code example shows 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].dwSearchPref = ADS_SEARCHPREF_DEREF_ALIASES;
prefInfo[0].vValue.dwType = ADSTYPE_INTEGER;
prefInfo[0].vValue.Integer = ADS_DEREF_ALWAYS;
hr = m_pSearch->SetSearchPreference(prefInfo, 1);

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.

See Also

ADSI Enumerations, IDirectorySearch