WTSEnumerateServersA function

Returns a list of all Remote Desktop Session Host (RD Session Host) servers within the specified domain.

Syntax

BOOL WTSEnumerateServersA(
  LPSTR             pDomainName,
  IN DWORD          Reserved,
  IN DWORD          Version,
  PWTS_SERVER_INFOA *ppServerInfo,
  DWORD             *pCount
);

Parameters

pDomainName

Pointer to the name of the domain to be queried. If the value of this parameter is NULL, the specified domain is the current domain.

Reserved

Reserved. The value of this parameter must be 0.

Version

Version of the enumeration request. The value of the parameter must be 1.

ppServerInfo

Points to an array of WTS_SERVER_INFO structures, which contains the returned results of the enumeration. After use, the memory used by this buffer should be freed by calling WTSFreeMemory.

pCount

Pointer to a variable that receives the number of WTS_SERVER_INFO structures returned in the ppServerInfo buffer.

Return Value

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

This function will not work if NetBT is disabled.

Requirements

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

See Also

WTS_SERVER_INFO