7.6.1.6 Performing an LDAP Operation on an ADConnection

This task sends an LDAP request to an Active Directory server.

The parameters for this task are as follows:

Name

Type

Description

Optional

TaskInputADConnection

ADCONNECTION_HANDLE

An ADCONNECTION_HANDLE ([MS-DTYP] section 2.2.2) that refers to an initialized ADConnection on which the LDAP request will be sent.

No

TaskInputRequestMessage

LDAPMessage

The request to send to the directory server.

No

TaskOutputResultMessages

List of LDAPMessage

The response from the directory server.

No

The task returns the following results to the caller:

Name

Type

Description

TaskReturnStatus

Unsigned integer

The LDAP resultCode ([RFC2251] section 4.1.10, Result Message) returned from the directory server in response to the request or an error indicating that the directory server could not be contacted or a timeout has occurred.

The task performs the following actions:

  1. Let adConnection be the ADConnection instance in ADCList referred to by TaskInputADConnection.

  2. Let ldapRequest be a freshly constructed instance of the LDAPRequest ADM structure type defined in section 7.3, ADConnection Abstract Data Model, initialized with default values as specified in that section.

  3. ldapRequest.requestMessage is set to TaskInputRequestMessage, an input parameter to the current task that indicates the request to be sent to the directory server.

  4. The current task invokes the task, Performing an LDAP Operation Against a Directory Server (section 7.6.2.5), with the following parameters: TaskInputConnectionInfo is set to adConnection.primaryConnection and TaskInputRequestMessage is set to ldapRequest.

  5. The current task waits for responses to arrive on ldapRequest.resultMessages. When the responses for the request have been received (see Getting an LDAP Response from a Directory Server (section 7.6.3.2)), TaskOutputResultMessages is set to ldapRequest.resultMessages. If no error is encountered, the LDAP resultCode of the last message in TaskOutputResultMessages is returned to the caller. Otherwise the error is returned.