Click to Rate and Give Feedback
DsGetDomainControllerInfo Function

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

Syntax

C++
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 clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
RedistributableActive Directory Client Extension onWindows NT 4.0andWindows Me/98/95
HeaderNtdsapi.h
LibraryNtdsapi.lib
DLLNtdsapi.dll
Unicode and ANSI namesDsGetDomainControllerInfoW (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

Send comments about this topic to Microsoft

Build date: 11/12/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
DS_DOMAIN_CONTROLLER_INFO_3      gwgaston   |   Edit   |   Show History
Where is the documentation for DS_DOMAIN_CONTROLLER_INFO_3 for 2008??
Tags What's this?: Add a tag
Flag as ContentBug
Typos in Requirements table      Thomas Lee   |   Edit   |   Show History
Under the Redistributable item - there are some missing spaces.

It reads:
Active Directory Client Extension onWindows NT 4.0andWindows Me/98/95

It should read:
Active Directory Client Extension on Windows NT 4.0 and Windows Me/98/95
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker