0.9b (c) 1995 Peter Childs
The function list all servers visible on the network.
Syntax
MyRc = NetEnumerate(NETSERVER, 'serverList') MyRc = NetEnumerate(NETSERVER, 'serverList', SrvName) MyRc = NetEnumerate(NETSERVER, 'serverList', SrvName, SrvType) MyRc = NetEnumerate(NETSERVER, 'serverList', SrvName, SrvType, DomainName)
Parameters
The parameters specified are:
'serverList' The REXX variable receiving the result. The variable is divided into:
o serverList.0
The number of servers found
o serverList.i
The server computer name entry i, where the variable i has a value from 1 to serverList.0
SrvType The server type values are defined as follows:
SV_TYPE_WORKSTATION = 1 /* Workstation */ SV_TYPE_SERVER = 2 /* Server */ SV_TYPE_SQLSERVER = 4 /* SQL server */ SV_TYPE_DOMAIN_CTRL = 8 /* Domain controller */ SV_TYPE_DOMAIN_BAKCTRL = 16 /* Backup domain controller */ SV_TYPE_TIME_SOURCE = 32 /* Time server */ SV_TYPE_AFP = 64 /* Apple File Protocol (AFP) service */ SV_TYPE_NOVELL = 128 /* Novell service */ SV_TYPE_ALL = -1 /* All types of servers */
SrvName The server computer name
DomainName The domain name
Note
The server computer name can be specified as '' for a local server or workstation.
The default values in the four different call forms are as follows:
2 parms The function executes on the local computer, list all domain controllers found in the logon domain and domains found in the 'other Domains' parameter
3 parms The function executes on the computer specified, list all domain controllers found in the logon domain and domains found in the 'other Domains' parameter
4 parms The function executes on the computer specified, list the server types specified in the logon domain and domains found in the 'other Domains' parameter
5 parms The function executes on the computer specified, list the server types specified in the domain specified
Example
/* Get the domain controller computer name */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSERVER = 160 SrvName = '\\DOMAIN_CONTRLR' SrvType = 8 /* Domain Controller */ DomainName = 'ITSO_AUSTIN_442' myRc = NetEnumerate(NETSERVER, 'serverList', SrvName, SrvType, DomainName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if serverList.0 = 0 then do say 'Domain controller was not found' call DropLsRxutFuncs exit 0 end say 'Number of servers found: ' serverList.0 say do i=1 to serverList.0 say serverList.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0
Example Output
Number of servers found: 1 DOMAIN_CONTRLR
Inf-HTML End Run - Successful