Platform SDK: Active Directory, ADSI, and Directory Services

DsListServersForDomainInSite

The DsListServersForDomainInSite function lists all the servers in a domain in a site.

DWORD DsListServersForDomainInSite(
  HANDLE hDs,
  LPTSTR domain,
  LPTSTR site,
  PDS_NAME_RESULTW *ppServers
);

Parameters

hDs
[in] Bind handle to the directory service.
domain
[in] Pointer to a null-terminated Unicode string specifying the name of the domain.
site
[in] Pointer to a null-terminated Unicode string specifying the name of the site.
ppServers
[out] Pointer to a variable that receives a pointer to a DS_NAME_RESULT structure containing the list of servers in the domain. The returned structure must be deallocated using DsFreeNameResult.

Return Values

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.

ERROR_INVALID_PARAMETER
A parameter is incorrect.
ERROR_NOT_ENOUGH_MEMORY
There is insufficient memory available.

Individual name conversion errors are reported in the returned DS_NAME_RESULT structure.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Ntdsapi.h.
  Library: Included as a resource in Ntdsapi.dll.
  Unicode: Implemented as Unicode and ANSI versions on Windows 2000.

See Also

DC and Replication Management Functions, DsFreeNameResult, DS_NAME_RESULT