DsListServersInSiteA function

The DsListServersInSite function lists all the servers in a site.

Syntax

NTDSAPI DWORD DsListServersInSiteA(
  HANDLE           hDs,
  LPCSTR           site,
  PDS_NAME_RESULTA *ppServers
);

Parameters

hDs

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

site

Pointer to a null-terminated string that specifies the site name. The site name uses a distinguished name format. It is taken from the list of sites returned by the DsListSites function.

ppServers

Pointer to a pointer to a DS_NAME_RESULT structure that receives the list of servers in the site. The returned structure must be freed using the DsFreeNameResult function.

Return Value

If the function returns a list of servers, 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.

Requirements

   
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header ntdsapi.h
Library Ntdsapi.lib
DLL Ntdsapi.dll

See Also

DS_NAME_RESULT

Domain Controller and Replication Management Functions

DsFreeNameResult