Platform SDK: Active Directory, ADSI, and Directory Services

ADS_CHASE_REFERRALS_ENUM

The ADS_CHASE_REFERRALS_ENUM enumeration specifies if and how referral chasing is pursued. When a server determines that other servers hold relevant information, in part or as a whole, it may refer the client to another server to obtain the result. Referral chasing is the action taken by a client to contact the referred-to server to continue the directory search.

typedef enum {
  ADS_CHASE_REFERRALS_NEVER         = 0x00,
  ADS_CHASE_REFERRALS_SUBORDINATE   = 0x20,
  ADS_CHASE_REFERRALS_EXTERNAL      = 0x40,
  ADS_CHASE_REFERRALS_ALWAYS        = 0x20 | 0x40
  } ADS_CHASE_REFERRALS_ENUM

Elements

ADS_CHASE_REFERRALS_NEVER
The client should never chase the referred-to server. Setting this option prevents a client from contacting other servers in a referral process.
ADS_CHASE_REFERRALS_SUBORDINATE
The client chases only subordinate referrals which are a subordinate naming context in a directory tree. For example, if the base search is requested for DC=Microsoft, DC=Com, and the server returns a result set and a referral of DC=Sales, DC=Microsoft, DC=Com on the AdbSales server, the client can contact the AdbSales server to continue the search. The ADSI LDAP provider always turns off this flag for paged searches.
ADS_CHASE_REFERRALS_EXTERNAL
The client chases external referrals. For example, a client requests server A to perform a search for DC=Microsoft,DC=Com. However, server A does not contain the object, but knows that an independent server, B, owns it. It then refers the client to server B.
ADS_CHASE_REFERRALS_ALWAYS
Referrals are chased for either the subordinate or external type.

Remarks

Use the constants of this enumeration to set up search preferences for referral chasing. The action amounts to assigning the appropriate fields of the ADS_SEARCHPREF_INFO structure with elements of the ADS_CHASE_REFERRALS_ENUM and ADS_SEARCHPREF_ENUM enumerations.

The ADSI LDAP provider supports external referrals for paged searches, but does not support subordinate referrals during paging.

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 code snippet illustrates how to set up search preference for chasing referrals, in a C/C++ application.

///////////
int idx;
ADS_SEARCHPREF_INFO prefInfo;
idx = m_cChaseReferrals.GetCurSel();
if ( idx != CB_ERR )
{
    prefInfo.dwSearchPref = ADS_SEARCHPREF_CHASE_REFERRALS;
    prefInfo.vValue.dwType = ADSTYPE_INTEGER;
    switch( idx )
    {
        case 0:
            prefInfo.vValue.Integer = ADS_CHASE_REFERRALS_NEVER;
            break;
        case 1:
            prefInfo.vValue.Integer = ADS_CHASE_REFERRALS_SUBORDINATE;
            break;
        case 2:
            prefInfo.vValue.Integer = ADS_CHASE_REFERRALS_EXTERNAL;
            break;
        default:
            prefInfo.vValue.Integer = ADS_CHASE_REFERRALS_EXTERNAL;
    }
}

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, ADS_SEARCHPREF_ENUM, ADS_SEARCHPREF_INFO