WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

wNT
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

List Terminal Servers


Question:

Has someone experience how I can get all Terminal server name into a list ?

There is a DOS command function how is working on a Terminalserver[QUERY SERVER or QUERY TERMSERVER....] but I would like to get this information directly from the system like the Terminal server Extender is working. Unfortunately the TS Extender doesn't contain the type of function.

Answer:

Using the Win32 Extender you can list the servers in the domain with TS enabled.
#DEFINEFUNCTION ListTSServers(DomainName)
AddExtender('WWWNT34I.DLL')
ErrorMode(@OFF)
ServerList = wntServerList('',DomainName,33554432)
RC = LastError()
ErrorMode(@CANCEL)

if (RC != 0)

TempMsg = StrCat('wntServerList("","',DomainName,'",33554432) RC = ',RC)

TempMsg = StrCat(TempMsg,@CRLF,@CRLF,'Error! Unable to obtain a list of terminal server systems.')

Message('ListTSServers()',TempMsg)

return ''

endif
return ServerList
#ENDFUNCTION 

Article ID:   W16045
File Created: 2004:03:30:15:42:30
Last Updated: 2004:03:30:15:42:30