Export (0) Print
Expand All

DsGetDomainControllerInfo function

The DsGetDomainControllerInfo function retrieves data about the domain controllers in a domain.

Syntax


DWORD DsGetDomainControllerInfo(
  _In_   HANDLE hDs,
  _In_   LPTSTR DomainName,
  _In_   DWORD InfoLevel,
  _Out_  DWORD *pcOut,
  _Out_  VOID **ppInfo
);

Parameters

hDs [in]

Contains a directory service handle obtained from either the DSBind or DSBindWithCred function.

DomainName [in]

Pointer to a null-terminated string that specifies the domain name.

InfoLevel [in]

Contains a value that indicates the version of the DS_DOMAIN_CONTROLLER_INFO structure to return. This can be one of the following values.

ValueMeaning
1

The function provides the domain data in the DS_DOMAIN_CONTROLLER_INFO_1 structure format.

2

The function provides the domain data in the DS_DOMAIN_CONTROLLER_INFO_2 structure format.

3

The function provides the domain data in the DS_DOMAIN_CONTROLLER_INFO_3 structure format.

 

pcOut [out]

Pointer to a DWORD variable that receives the number of items returned in ppInfo array.

ppInfo [out]

Pointer to a pointer variable that receives an array of DS_DOMAIN_CONTROLLER_INFO_* structures. The type of structures in this array is defined by the InfoLevel parameter. The caller must free this array, when it is no longer required, by using the DsFreeDomainControllerInfo function.

Return value

If the function returns domain controller data, the return value is ERROR_SUCCESS. If the caller does not have the privileges to access the server objects, the return value is ERROR_SUCCESS, but the DS_DOMAIN_CONTROLLER_INFO structures could be empty.

If the function fails, the return value can be one of the following error codes.

Return codeDescription
ERROR_DS_INTERNAL_FAILURE

The version of the DS_DOMAIN_CONTROLLER_INFO structure returned by the domain controller did not match the version requested in InfoLevel.

ERROR_DS_OBJ_NOT_FOUND

DomainName is not NULL and contains an invalid domain name.

ERROR_INVALID_PARAMETER

One or more parameters are invalid.

ERROR_NOT_SUPPORTED

The requested version of the directory service server extensions is not supported.

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Redistributable

Active Directory Client Extension on Windows NT 4.0 and Windows Me/98/95

Header

Ntdsapi.h

Library

Ntdsapi.lib

DLL

Ntdsapi.dll

Unicode and ANSI names

DsGetDomainControllerInfoW (Unicode) and DsGetDomainControllerInfoA (ANSI)

See also

Domain Controller and Replication Management Functions
DS_DOMAIN_CONTROLLER_INFO_1
DS_DOMAIN_CONTROLLER_INFO_2
DS_DOMAIN_CONTROLLER_INFO_3
DsBind
DsBindWithCred
DsFreeDomainControllerInfo

 

 

Show:
© 2014 Microsoft