WTSEnumerateServers function
Returns a list of all Remote Desktop Session Host (RD Session Host) servers within the specified domain.
Syntax
BOOL WTSEnumerateServers( _In_ LPTSTR pDomainName, _In_ DWORD Reserved, _In_ DWORD Version, PWTS_SERVER_INFO *ppServerInfo, DWORD *pCount );
Parameters
- pDomainName [in]
-
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 [in]
-
Reserved. The value of this parameter must be 0.
- Version [in]
-
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 |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
WTSEnumerateServersW (Unicode) and WTSEnumerateServersA (ANSI) |
See also