Compartilhar via


7.6.1.1 Initializing an ADConnection

This task initializes an instance of the ADConnection element and returns it to the caller.

The parameters for this task are as follows:

Name

Type

Description

Optional

TaskInputTargetName

String(Unicode)

A string used to locate a domain controller. It can be NULL (which indicates that the joined domain name SHOULD be used), a domain name (DNS/NetBIOS), a server host name, or a server IP address.

No

TaskInputPortNumber

Unsigned integer

The destination TCP port number ([RFC793] section 1.5, Operation) to use when connecting to the directory server specified by TaskInputTargetName.

No

The task returns the following results to the caller:

Name

Type

Description

TaskReturnADConnection

ADCONNECTION_HANDLE

An ADCONNECTION_HANDLE ([MS-DTYP] section 2.2.2) that refers to an instance of the ADConnection ADM element.

The task performs the following actions:

  1. Create an instance of the ADConnection ADM structure and initialize the values in the ADM to their default values. This instance is added to the list ADCList.

  2. Invoke the Initializing a Connection to a Directory Server (section 7.6.2.1) task, passing the TaskInputTargetName and TaskInputPortNumber parameters provided by the caller of this task. The returned TaskReturnConnectionInfo is assigned to ADConnection.primaryConnection.

  3. Using TaskReturnADConnection, return an ADCONNECTION_HANDLE ([MS-DTYP] section 2.2.2) that refers to the ADConnection instance to the caller.