log in script question

Kohei Yoshida kyoshida at mesco.com
Wed Nov 28 09:50:04 GMT 2001


Hi Tony,

The only way that I can think of to achieve something like this is by
writing a server-side script that creates a logon script on the fly
based on the username given as an argument.  Then add in smb.conf

[global]
   logon script = logon.bat
[netlogon]
   preexec = /path/to/the/script %u

and have the script create a file named 'logon.bat' when the user logs
in.  This way you can have the script check if the user is member of a
certain Unix group, and if so, have it add a line like "net use X:
\\path\to\group\share" in the 'logon.bat' file.  If you're familiar with
Python, this can be done by calling

import grp
grp.getgrnam('name-of-group')[3]

which returns a list of users who belong to the group named
'name-of-group'.  The rest is just a matter of coding.

Hope this helps.

Kohei

On Tue, 2001-11-27 at 17:40, Tony Ricker wrote:
> All,
> 	I was hoping someone could point me in the right direction in obtaining
> a solution to the the following; I want to have the log in script map
> not only their home directory, but also the group folders as well. For
> instance, I would have a share with valid users=@usergroup and would
> want the script to map the directory based on this criteria. Would I
> have to have a log on script for each group? I hope I have been clear on
> what functionality I am seeking. If anyone needs anymore info, please
> let me know. I appreciate any and all help.
> 
> Cheers,
> 
> Tony
> -- 
> -------------------------------
> Tony Ricker
> Technology Coordinator
> SLUCare - P.M.O.
> St. Louis University
> Phone:  314.977.6844
> E-mail: rickera2 at slu.edu
> -------------------------------
> "In the beginners mind, there 
> are many possibilities. In the 
> experts mind, there are few"
> - Shunryu Suzuki
> -------------------------------
> "Think Different"
> 
> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba
> 






More information about the samba mailing list