Location: Symbol Reference > Classes > TJwTerminalServer Class > TJwTerminalServer Methods > TJwTerminalServer.EnumerateServers Method
JWSCL Documentation
ContentsIndexHome
PreviousUpNext
TJwTerminalServer.EnumerateServers Method
Pascal
function EnumerateServers(const ADomain: TJwString): Boolean;
Parameters 
Description 
const ADomain: TJwString 
name of the Domain to be queried, if empty string is specified the current domain is queried  

If the function fails you can use GetLastError to get extended error information

EnumerateServers enumerates all Terminal Servers in the specified domain. The result will be stored in readonly property Servers

 

This functions enumerates all Terminal Servers that advertise themselves on the network. By default only Terminal Servers in Application Mode advertise themselves. You can override this behaviour by modifying the following registry key:

 HKLMSYSTEMCurrentControlSetControlTerminal Server
"TSAdvertise" = REG_DWORD:1

Changing this value may be an security issue. Do not alter it without the consent of the user! Only use the values 0 and 1. Do not use any other values! 

 

Please note that enumerating Terminal Servers in large environments might take some time (especially over slow WAN links). Therefore this function runs in a seperate thread and signals the OnServersEnumerated Event. The enumerated servers can be retreived by reading the Servers property. 

If the TJwTerminalServer Instance is destroyed and the enumeration thread is still busy, the TJwTerminalServer will wait max. 1 second for the thread to finish and then terminates it. 

This method is not threadsafe! Do not call or use the instance from several threads without locking mechanism 

Check for a nil property value Servers 

Copyright (c) 2010. All rights reserved.
This help was created by Doc-O-Matic sponsored by toolsfactory software inc.
What do you think about this topic? Send feedback!