Shane's example will work, but will assume that all networks are /24. This is unrealistic in most situations. Using the IsInSubnet UDF will match on any CIDR address. A good example of this is if I change the record that represents my network subnet from 172.20.195.0 to 172.20.190.0, my server would change from ServerL to ServerA, because my IP address would be part of the larger network 172.16.0.0/16.

Here's a clean version of my example:
 Code:
Break Off

 call .\EnumINI.udf'
 call .\IsInSubnet.udf'

; This loads an array of W.X.Y.Z/mask network ranges
$aNetworks = EnumIni('.\subnets.ini', 'SUBNET_LOOKUP')			; load subnet table from common location
'There are ' UBound($aNetworks) + 1 ' records in the array' ?


; Get my IP address in normalized (no spaces) format
$MyIP = Join(Split(@IPADDRESS0, ' '), '')				; remove spaces
'My IP Address is ' $MyIP ?

; Pass IP and network table to UDF, returning an array of 0/1 values. 
; If the table is defined in most to least specific order, the first 
; value that is set represents the network subnet where the host resides
$aNetwork = IsInSubnet($MyIP, $aNetworks)                           ; get network ID (array element)


; find the first "1" in the array returned (may required additional args)
$Net = AScan($aNetwork, 1)                                          ; get first network that host is a member of


; Using the element returned above, get the value to read from the INI file
$Network = $aNetworks[$Net]                                         ; return the network/mask for lookup
$aNetworks[$Net] ?

; Read the server name from the central INI file
$Server = ReadProfileString('.\subnets.ini', 'SUBNET_LOOKUP', $Network) ; lookup the server name for this network

'My server: ' $Server ?
I added my local and regional networks to the ini as shown here:
 Code:
[SUBNET_LOOKUP]
10.11.1.0/24=Server1
10.11.2.0/24=Server2
10.0.0.0/8=Default_Server
172.20.195.0/24=ServerL
172.16.0.0/16=ServerA
Note that this assumes that the UDF files and the SUBNETS.INI file are in the current folder, which is reasonable for testing. When I run this script, I get the following output:
 Code:
There are 5 records in the array
My IP Address is 172.20.195.81
172.20.195.0/24
My server: ServerL
Glenn
_________________________
Actually I am a Rocket Scientist! \:D