Novell Home

Keeping Logins Painless for Roaming Users

Novell Cool Solutions: Trench
By Florian Deckert

Digg This - Slashdot This

Posted: 29 Jul 2003
 

Problem

Allowing roaming users to always log in at the nearest server in Full-IP environment, without having them to change the default server in the login dialog box

Solution

  1. Set the default server empty in the user account.

  2. Install a login script checking the user's ip address and setting the default variable.
    1. IP addresses are converted to hex to be tested:
      (if testing 172.16.0.0/24 : if NETWORK_ADDRESS > "AC100000" and NETWORK_ADDRESS < "AC10FFFF" then
      )
    2. Use a variable to store the server's name and use it to map the volume:
      (set my_file_server = "MARS" map f:=%<my_file_server>/sys:)
    3. Map common drive depending of the server & the volume:
      (set my_win = "%<my_file_server>/doi:"
      if <my_file_server> = "OXF-NW" set my_win="%<my_file_server>/data:"
      if <my_file_server> = "RUBIS" then set my_win=".diamant_win.puteaux.sopra:"
      map root w:=%<my_win>\win

  3. Drawback : duplicate the script to all context to avoid any tree walking.

Example

; ******* SELECT the right file server ******

if  "%MESSAGE SERVER" <> "" then
   if  "%MESSAGE SERVER"  = "NEPTUNE.projet1." then
      set my_file_server = "NEPTUNE"
   else 
      set my_file_server = "%MESSAGE SERVER"
   end
else
  if NETWORK_ADDRESS > "AC100000" and NETWORK_ADDRESS < "AC10FFFF"
  	then set my_file_server = "MARS"
  end
  if NETWORK_ADDRESS > "AC170000" and NETWORK_ADDRESS < "AC17FFFF"
  	then set my_file_server = "RUBIS"
  end
  if NETWORK_ADDRESS > "C0A8CA00" and NETWORK_ADDRESS < "C0A8CAFF"
  	then set my_file_server = "VICTOIRE"
  end
  if NETWORK_ADDRESS > "C0A8BF00" and NETWORK_ADDRESS < "C0A8BFFF"
  	then set my_file_server = "BACCHUS"
  end
  if NETWORK_ADDRESS > "C0A83400" and NETWORK_ADDRESS < "C0A834FF"
  	then set my_file_server = "CLARUS"
  end
  if NETWORK_ADDRESS > "AC150000" and NETWORK_ADDRESS < "AC15FFFF"
  	then set my_file_server = "NOE"
  end
  if NETWORK_ADDRESS > "AC160000" and NETWORK_ADDRESS < "AC16FFFF"
  	then set my_file_server = "ARAKIS"
  end
  if NETWORK_ADDRESS > "C0A8EB00" and NETWORK_ADDRESS < "C0A8EBFF"
  	then set my_file_server = "CHANEL"
  end
  if NETWORK_ADDRESS > "AC140000" and NETWORK_ADDRESS < "AC14FFFF"
  	then set my_file_server = "RAMSES"
  end
  if NETWORK_ADDRESS > "AC190000" and NETWORK_ADDRESS < "AC19FFFF"
  	then set my_file_server = "FIDJI"
  end
  if NETWORK_ADDRESS > "AC120000" and NETWORK_ADDRESS < "AC12FFFF"
  	then set my_file_server = "MERLIN"
  end
  if NETWORK_ADDRESS > "AC180000" and NETWORK_ADDRESS < "AC18FFFF"
  	then set my_file_server = "ECU"
  end
  if NETWORK_ADDRESS > "AC130000" and NETWORK_ADDRESS < "AC13FFFF"
  	then set my_file_server = "VADOR"
  end
  if NETWORK_ADDRESS > "C0A8C100" and NETWORK_ADDRESS < "C0A8C1FF"
  	then set my_file_server = "VERNES"
  end
  if NETWORK_ADDRESS > "C0A8BE00" and NETWORK_ADDRESS < "C0A8BEFF"
  	then set my_file_server = "SOLOGNE"
  end
  if NETWORK_ADDRESS > "AC1D0000" and NETWORK_ADDRESS < "AC1DFFFF"
  	then set my_file_server = "MONET"
  end
  if NETWORK_ADDRESS > "AC1A0000" and NETWORK_ADDRESS < "AC1AFFFF"
  	then set my_file_server = "ASTERIX"
  end
  if NETWORK_ADDRESS > "C0A82200" and NETWORK_ADDRESS < "C0A822FF"
  	then set my_file_server = "IDEFIX"
  end
  if NETWORK_ADDRESS > "C0A8C300" and NETWORK_ADDRESS < "C0A8C3FF"
  	then set my_file_server = "JEANNE"
  end
  if NETWORK_ADDRESS > "C0A81900" and NETWORK_ADDRESS < "C0A819FF"
  	then set my_file_server = "FARON"
  end
  if NETWORK_ADDRESS > "C0A8C400" and NETWORK_ADDRESS < "C0A8C4FF"
  	then set my_file_server = "CAPITOLE"
  end
  if NETWORK_ADDRESS > "C0A83000" and NETWORK_ADDRESS < "C0A830FF"
  	then set my_file_server = "MADIRAN"
  end
  if NETWORK_ADDRESS > "C0A8BA00" and NETWORK_ADDRESS < "C0A8BAFF"
  	then set my_file_server = "GUEUZE"
  end
  if NETWORK_ADDRESS > "c0a83600" and NETWORK_ADDRESS < "c0a836FF"
  	then set my_file_server = "BEETHOVEN"
  end
  if NETWORK_ADDRESS > "c0a83800" and NETWORK_ADDRESS < "c0a838FF"
  	then set my_file_server = "DOMMEL"
  end
  if NETWORK_ADDRESS > "c0a82800" and NETWORK_ADDRESS < "c0a828FF"
  	then set my_file_server = "FAUST"
  end
  if NETWORK_ADDRESS > "C0A81C00" and NETWORK_ADDRESS < "C0A81CFF"
  	then set my_file_server = "SCALA"
  end
  if NETWORK_ADDRESS > "AC1C0000" and NETWORK_ADDRESS < "AC1CFFFF"
  	then set my_file_server = "THOR"
  end
  if NETWORK_ADDRESS > "c0a8c800" and NETWORK_ADDRESS < "c0a8c8FF"
  	then set my_file_server = "BALKIS"
  end
  if NETWORK_ADDRESS > "c0a8c900" and NETWORK_ADDRESS < "c0a8c9FF"
  	then set my_file_server = "OLYMPE"
  end
  if NETWORK_ADDRESS > "C0A82B00" and NETWORK_ADDRESS < "C0A82BFF"
  	then set my_file_server = "EDN-NW"
  end
  if NETWORK_ADDRESS > "C0A81E00" and NETWORK_ADDRESS < "C0A81EFF"
  	then set my_file_server = "LON-NW"
  end
  if NETWORK_ADDRESS > "C0A82D00" and NETWORK_ADDRESS < "C0A82DFF"
  	then set my_file_server = "OXF-NW"
  end
  if NETWORK_ADDRESS > "C0A82900" and NETWORK_ADDRESS < "C0A829FF"
  	then set my_file_server = "STEV-NW"
  end
  if NETWORK_ADDRESS > "C0A82A00" and NETWORK_ADDRESS < "C0A82AFF"
  	then set my_file_server = "UXB-NW"
  end
end

; ***** SELECT the WIN volume *****

;default WIN on DOI:
set my_win = "%<my_file_server>/doi:"

;in UK switch to DATA:
if <my_file_server> = "OXF-NW" or <my_file_server>="STEV-NW"
	then set my_win="%<my_file_server>/data:"
if <my_file_server> = "UXB-NW" or <my_file_server>="LON-NW"
	then set my_win="%<my_file_server>/data:"
if <my_file_server> = "EDN-NW"
	then set my_win="%<my_file_server>/data:"

;on cluster switch to the nds volume
if <my_file_server> = "RUBIS" or <my_file_server>="OPALE"
	then set my_win=".diamant_win.puteaux.sopra:"
if <my_file_server> = "MERLIN" or <my_file_server>="GANDALF"
	then set my_win=".magic_win.lyon.sopra:"
if <my_file_server> = "NEPTUNE" or <my_file_server>="JUPITER"
	then set my_win=".pluton_win.annecy.sopra:"
if <my_file_server> = "ECU" or <my_file_server>="EURO"
	then set my_win=".denier_win.mattei.sopra:"

; ***** Execute Mapping ******

write "My server :";<my_file_server>
map f:=%<my_file_server>/sys:
map r s16:=%<my_file_server>/sys:public
map root w:=%<my_win>\win

If you have questions about this brilliant script, Florian can be reached at fdeckert@sopragroup.com.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell