Directory Services |
The DsGetDomainControllerInfo function retrieves data about the domain controllers in a domain.
DWORD DsGetDomainControllerInfo( HANDLE hDs, LPTSTR DomainName, DWORD InfoLevel, DWORD* pcOut, VOID** ppInfo );
Value | Meaning |
---|---|
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. |
If the function fails, the return value can be one of the following error codes.
Return Code | Description |
---|---|
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 unsupported. |
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension
on Windows NT 4.0 SP6a and Windows 95/98/Me.
Unicode: Implemented as Unicode and ANSI versions on Windows
NT/2000/XP.
Header: Declared in Ntdsapi.h.
Library: Use Ntdsapi.lib.
DsBind, DsBindWithCred, DS_DOMAIN_CONTROLLER_INFO_1, DS_DOMAIN_CONTROLLER_INFO_2, DsFreeDomainControllerInfo, Domain Controller and Replication Management Functions