Skip to content

Latest commit

 

History

History
155 lines (94 loc) · 5.72 KB

nf-ntdsapi-dsgetdomaincontrollerinfow.md

File metadata and controls

155 lines (94 loc) · 5.72 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:ntdsapi.DsGetDomainControllerInfoW
DsGetDomainControllerInfoW function (ntdsapi.h)
Retrieves data about the domain controllers in a domain. (Unicode)
1
2
3
DsGetDomainControllerInfo
DsGetDomainControllerInfo function [Active Directory]
DsGetDomainControllerInfoW
_glines_dsgetdomaincontrollerinfo
ad.dsgetdomaincontrollerinfo
ntdsapi/DsGetDomainControllerInfo
ntdsapi/DsGetDomainControllerInfoW
ad\dsgetdomaincontrollerinfo.htm
ad
52db3b25-e6b0-4a0d-831b-89a203580cf1
12/05/2018
1, 2, 3, DsGetDomainControllerInfo, DsGetDomainControllerInfo function [Active Directory], DsGetDomainControllerInfoA, DsGetDomainControllerInfoW, _glines_dsgetdomaincontrollerinfo, ad.dsgetdomaincontrollerinfo, ntdsapi/DsGetDomainControllerInfo, ntdsapi/DsGetDomainControllerInfoA, ntdsapi/DsGetDomainControllerInfoW
ntdsapi.h
Windows
Windows Vista
Windows Server 2008
DsGetDomainControllerInfoW (Unicode) and DsGetDomainControllerInfoA (ANSI)
Ntdsapi.lib
Ntdsapi.dll
Windows
19H1
DsGetDomainControllerInfoW
ntdsapi/DsGetDomainControllerInfoW
c++
APIRef
kbSyntax
DllExport
Ntdsapi.dll
API-MS-Win-Security-ActiveDirectoryClient-l1-1-0.dll
KernelBase.dll
API-Ms-Win-Security-ActiveDirectoryClient-L1-1-1.dll
DsGetDomainControllerInfo
DsGetDomainControllerInfoA
DsGetDomainControllerInfoW

DsGetDomainControllerInfoW function

-description

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

-parameters

-param hDs [in]

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

-param DomainName [in]

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

-param 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.

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.

-param pcOut [out]

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

-param 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.

- InfoLevel.1

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

- InfoLevel.2

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

- InfoLevel.3

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

-returns

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.

-see-also

DS_DOMAIN_CONTROLLER_INFO_1

DS_DOMAIN_CONTROLLER_INFO_2

DS_DOMAIN_CONTROLLER_INFO_3

Domain Controller and Replication Management Functions

DsBind

DsBindWithCred

DsFreeDomainControllerInfo

-remarks

Note

The ntdsapi.h header defines DsGetDomainControllerInfo as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.