Export (0) Print
Expand All

ADS_DEREFENUM enumeration

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

Syntax


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

Constants

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.

Examples

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

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Iads.h

See also

ADSI Enumerations
IDirectorySearch

 

 

Show:
© 2015 Microsoft