DsListInfoForServerA function (ntdsapi.h)
The DsListInfoForServer function lists miscellaneous data for a server.
Syntax
NTDSAPI DWORD DsListInfoForServerA(
[in] HANDLE hDs,
[in] LPCSTR server,
[out] PDS_NAME_RESULTA *ppInfo
);
Parameters
[in] hDs
Contains a directory service handle obtained from either the DSBind or DSBindWithCred function.
[in] server
Pointer to a null-terminated string that specifies the server name. This name must be the same as one of the strings returned by the DsListServersForDomainInSite or DsListServersInSite function.
[out] ppInfo
Pointer to a variable that receives a pointer to a DS_NAME_RESULT structure that contains the server data. The returned structure must be deallocated using DsFreeNameResult.
The indexes of the array in the DS_NAME_RESULT structure indicate what data are contained by each array element. The following constants may be used to specify the desired index for a particular piece of data.
DS_LIST_ACCOUNT_OBJECT_FOR_SERVER
Name of the account object for the domain controller (DC).
DS_LIST_DNS_HOST_NAME_FOR_SERVER
DNS host name of the DC.
DS_LIST_DSA_OBJECT_FOR_SERVER
GUID of the directory service agent (DSA) for the domain controller (DC).
Return value
If the function returns server data, the return value is NO_ERROR.
If the function fails, the return value can be one of the following error codes.
Remarks
Individual name conversion errors are reported in the returned DS_NAME_RESULT structure.
Note
The ntdsapi.h header defines DsListInfoForServer 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.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
Target Platform | Windows |
Header | ntdsapi.h |
Library | Ntdsapi.lib |
DLL | Ntdsapi.dll |