Evaluate the Network Address in a Login Script

  • 7015348
  • 10-Jul-2014
  • 10-Jul-2014

Environment

Novell Client 2 SP3 for Windows

Situation

How to map drives, etc. depending on the network address of the workstation
How to discover the network address of a workstation

Resolution

Place the MAP (or other action) statements inside an IF...THEN statement which tests the network address.

In the IF...THEN statement, evaluate the network address to determine if it is > [greater than] the first IP address in the range and < [less than] the last IP address in the range. For example, given the "IF...THEN" statement:

IF NETWORK_ADDRESS > "0A033F00" AND NETWORK_ADDRESS < "0A033FFE" THEN
MAP S16:=MYSERVER\SYS:PUBLIC
END

In this example, the MAP statements within the IF statement will execute if the workstation's IP address is between "0A033F00" (10.3.63.0) and "0A033FFE" (10.3.63.254).

Additional Information

IP addresses can be converted to their HEX equivalents by converting them octet by octet using the "programmer" view in CALC.EXE, or other IP subnet calculators available on the web.

Another way to determine what HEX value is assigned to the IP address on the client, place the following command in a login script:

WRITE "The HEX IP Address of this workstation is: %NETWORK_ADDRESS"