Directory Services |
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;
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.
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);
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.