wntServiceAt

Lists all servers in a domain which contain a specified service.

Syntax:

wntServiceAt(server, domain, server-type, service-name, flags [, display-flags])

Parameters:

(s) server-name: the UNC name of the server on which the function will execute (e.g., "\\MYSERVER"), or ("") for the local computer.

(s) domain: the name of the domain which will be used (e.g., "SALES"), or ("") for the primary domain.

(i) server-type: identifies the type of servers which will be examined. See below.

(s) service-name: the name of the service to be looked for.

(i) flags: specifies information on the service being looked for. See below.

(i) display-flags: optional bitmask:
0 no progress dialog (default).
32 a progress dialog is displayed.
64 updates to the progress dialog box will be delayed so that the user can actually see the values.

Returns:

(i) a tab-delimited list of server UNC names(e.g., "\\MYSERVER"). Note: An NT workstation can be considered to be a "server".

 

Server-type

Specify -1 for all servers. Or, specify one or more of the following flags, combined using the binary OR ("|") operator.

 

Req#

 

Server Type

1

2

4

8

16

32

64

128

256

512

1024

2048

4096

8192

16384

32768

65536

131072

262144

524288

4194304

8388608

16777216

33554432

67108864

268435456

536870912

1073741824

-2147483648

All LAN Manager workstation

All LAN Manager server

Any server running with Microsoft SQL Server

Primary domain controller

Backup domain controller

Server running the timesource service

Apple File Protocol servers

Novell servers

LAN Manager 2.x Domain Member

Server sharing print queue

Server running dialin service

Xenix server

Windows NT (either workstation or server)

Server running Windows for Workgroups

Microsoft File and Print for Netware

Windows NT Non-DC server

Server that can run the browser service

Server running a browser service as backup

Server running the master browser service

Server running the domain master browser

Windows 95 or newer

Root of a DFS tree

NT Cluster

Terminal Server(Hydra)

NT Cluster Virtual Server Name

IBM DSS (Directory and Security Services) or equivalent

Return list for alternate transport

Return local list only

Domain announcement

 

Service-Name

'Service name' is the name of a service (e.g., "Spooler") or driver (e.g., "Atdisk"). The name can be specified either as the "display name" which is listed in Control Panel (name-type = 0) or the "service name" which is the actual registry key for the service (name-type = 1000). The SDK documentation describes them as:

 

DisplayName = a string that is to be used by user interface programs to identify the service.

ServiceName = a string that names a service in a service control manager database.

 

So, the following two commands will yield identical results:

 

servers = wntServiceAt("", "", -1, "Browser", 101) ; display name

servers = wntServiceAt("","", -1,"Computer Browser", 1001) ;service name

 

Flags

'Flags' specifies information on the service being looked for. It consists of one entry from each of the following three groups, added together:

 

Req# service type

1  services 

2  drivers 

3  both 

 

Req# service state

100  active services 

200  inactive services 

300  both 

 

Name type indicates what the 'service-name' parameter represents.

Req# name type

0  display name (the name shown in Control Panel) 

1000  service name (the actual registry key name)

 

Note: This function can take a while to run, depending on how many servers are in the domain. Also, it will only return the names of servers which it is able to access, which requires that the user have browse access to their service control managers.

 

Example:
; Load Appropriate Extender
AddExtender('wwwnt34i.dll',0,'wwwnt64i.dll')

;return a list of all servers running the "Spooler" service servers = wntServiceAt("", "", -1, "Spooler", 101, 0) AskItemlist("Lan Manager Servers",servers,@TAB,@SORTED,@SINGLE)
;return a list of all NT machines with an "Atdisk" driver installed servers = wntServiceAt("", "", 4096, "Atdisk", 302, 0) AskItemlist("Lan Manager Servers",servers,@TAB,@SORTED,@SINGLE) Exit