@ENUMSERVERS[n,server[,type]] : Enumerate the servers on the network. n is the entry number in the list of servers (the first one is 0). server is the machine name(s) to match and it may contain wildcards. Returns a null string if there are fewer than n-1 matching servers. This function can be repeatedly called, incrementing n each time to enumerate all available server names until it returns a null string.

 

If n is -1, @ENUMSERVERS returns the number of matching servers.

 

@ENUMSERVERS takes an optional third argument to return only servers of that type. The possible types are:

 

 WORKSTATION - All workstations.

 SQLSERVER - Any server running Microsoft SQL Server

 DOMAIN - Primary domain controller

 DOMAINBACKUP - Backup domain controller

 DOMAIN_ENUM - Primary domain

 LOCAL - Servers maintained by the browser

 AFP - Apple File Protocol servers

 TIME - Servers running the Timesource service

 PRINTQ - Server sharing print queue

 TERMINAL - Terminal Servers

 CLUSTER - Server clusters in the domain

 VSCLUSTER - Cluster virtual servers in the domain

 MASTER - Server running the master browser service

 

WARNING! Windows may require a significant amount of time before returning data to this function when used on large networks.

 

Examples:

 

echo %@enumservers[0,L*]

\\LINKSTATION

 

for %i in (0 1 2) echo %@enumservers[%i,*]

\\LINKSTATION

\\MUSIC

\\WEBHOST