Hi everyone,
I've just completed a new method of logging my users in that I thought many of you might appreiciate.
It starts with SAMBA 2.2.1a running on a Linux box. A very cool feature of SAMBA is that you can create NetBIOS aliases, or virtual servers. What that does is to make a virtual machine that shows up in network neighborhood, just like any other computer on your network. To take advantage of this feature, you add a line (the last line in the [global] section) to smb.conf that includes another .conf file. Using the %L SAMBA macro to denote the server name that was selected to name the file, as in
code:
include=smb.conf.%L


or for example, if the virtual server was named 'accounting', the included configuration file would be actually be named 'smb.conf.accounting'. If you compile SAMBA with the '--with-msdfs' switch, you can create MS compatible Distributed File Systems. (search for DFS on the web if you are unaware of the power of this cool file system). But, unlike Windows, a SAMBA server can host any number of DFS roots - a MAJOR plus. Anyway, you'll need to read up on DFS and SAMBA to get the most out of this logon.kix, but here is what I did and it works great:
I created a VS (Virtual Server) for each department where I work. I created global groups in Win2K with the same names as the VSs I made. In each VSs smb.conf.<VS-name> config file I loaded a MSDFS tree that gets it's shares from various servers throughout our organization. Some individuals are members of multiple groups, so they get drives mapped pointing to several VSs, and hence several DFS roots. Others only need their own groups shares. Everyone in the company maps to a common DFS tree. But enough preamble, here is the code in KiXtart that pulls it all together. If you have any questions, feel free to email me at cbarry@infiniconsys.com . Of course my group names and drive letters are specific to my site, but the method of group identification and drive letter assignment and mapping may prove useful to you even if you don't go the SAMBA route. Cheers.
code:

break on
cls
$LogFile="\\cbarry\!download\logfiles\logon.log"
$Groups='infinicon','accounting','documentation','hardware','mechanical','officers','software','support','sysadmin'
$Drives='I:','N:','O:','H:','M:','F:','S:','P:','Y:'
global $MyGroups[9]
global $MyDrives[9]
$i=0
$j=0
function GetGroups()
for each $Group in $Groups
if ingroup("infiniconsys\"+$Group)
$MyGroups[$i]=$Group
$MyDrives[$i]=$Drives[$j]
$i=$i+1
endif
$j=$j+1
next
endfunction

function MapDrives($pMyGroups, $pMyDrives, $pUserName)
c:
use * /delete
use u: "\\zeppelin\home\"+$pUserName
$i=0
for each $Share in $pMyGroups
if $Share
use $pMyDrives[$i] "\\"+$Share+"\"+$Share
$i=$i+1
else
return
endif
next
if exist("u:\logon.bat")
shell "cmd /c u:\logon.bat"
endif
endfunction

:main
GetGroups()
MapDrives($MyGroups, $MyDrives, @USERID)

:logging
redirectoutput($LogFile)
? " "
? "---------------------------------"
? @USERID
? @DATE+" "+@TIME
$i=0
for each $x in $MyGroups
if $x
? $MyDrives[$i]+" is mapped to "+$MyGroups[$i]
$i=$i+1
else
? "---------------------------------"
return
endif
next
? "---------------------------------"
:end


[ 06 September 2001: Message edited by: Christopher Barry ]