[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mapping directories to win clients, base on groupmembership.



Am Donnerstag 19 August 2004 22:24 schrieb Jarle Osmund Vågen:
> Has anyone thought or tried this with debian-edu?

Hi Jarle,

yes, before I had access to our linux server, all I could do for optimization 
was to enhance the login.bat script for our NT clients. Hence I can tell you 
some "tricks" on how to map the right share for the right user (We are not 
talking about home directories, but shares for groups):

i. At our school, classes have "real names" they keep all the time - like 
"sirius" or "ocean". All classes have unique identifies referring to their 
names - like SR or OC. This gives me the opportunity to lead every user's 
user name but their class's ID. All pupils in "sirius" hence start with 
"sr-". Therefor I can determine what class a user is in by testing an 
alphanumerical interval:

<login-script>
if /i %username% GEQ SR- if /i %username% LEQ SR0 set year=2001& goto MAP
if /i %username% GEQ OC- if /i %username% LEQ OC0 set year=2002& goto MAP
...
:MAP
IF exist Y:\ net use Y: /delete >NUL
net use Y: \\skolelinux\Y%year% >NUL
</login-script>

First two lines are samples on how to test if the user name is in a range 
indicating the membership to class "sirius" (SR): 

if $username >= "SR-" if $username <="SR0" year=2001 -> break

when the year is clear, a jump to MAP is done, where the corresponding drive 
is mapped as Y:

ii. Sometimes you cannot tell a user's membership by their username. Then you 
can probe their rights and thus get information on what course this user 
belongs to. Imagine that all share directories in question include one dummy 
file named "access.chk" that can only be read by members of the owning group. 
Now you can check how follows:

<login-script>
if /i exist \\skolelinux\class01\access.chk set class=01& goto X
if /i exist \\skolelinux\class02\access.chk set class=02& goto X
...
X:
IF exist T:\ net use T: /delete >NUL
net use T: \\skolelinux\class%class% >NUL

</login-script>

I think this is quite straight forward. 
If somebody likes to put this in "the" FAQ - I wouldn't mind. (AFAIK Gavin 
offered to maintain a FAQ - iff there was a separate users list..... )

Regards
Ralf



Reply to: