Hi, I work for a school district and am in the middle of configuring a SAMBA server to provide our students and faculty with the capabilites to save thier data on the SAMBA server. Is there a way to setup different logins for students and staff? My current logon script line is as follows: logon script = homelogon.bat I know you can youa %u varialbe and assign individual logon scripts for each user, but this is unneccssary. Instead is there a group variable I could use to have staff.bat and a student.bat login script run according to which group the person is in? Any comments or suggestions are welcome. Feel free to email me directly as well as thourgh this list. Aaron Zuercher Assistant System Administrator Pekin School District 108 Pekin, IL
"A. Zuercher" <aaron@otherland.pekin.net> wrote:> scripts for each user, but this is unneccssary. Instead is > there a group variable I could use to have staff.bat and a > student.bat login script run according to which group the > person is in?I too am trying to do this.. I have dynamic logons working from the example in samba integrating unix and windows.. but need to get the groups from unix so I can use them to map drives in my perl logon script. if any perl deity is hanging about.. please help. ash
Aaron Zuercher wrote: | Is there a way to setup different logins for students and | staff? My current logon script line is as follows: logon script = homelogon.bat Sure, use %G or %g in the path to the script: %G is the primary group name of %U (requested username) %g is the primary group name of %u (actual username) --dave -- David Collier-Brown, | Always do right. This will gratify some people 185 Ellerslie Ave., | and astonish the rest. -- Mark Twain Willowdale, Ontario | //www.oreilly.com/catalog/samba/author.html Work: (905) 415-2849 Home: (416) 223-8968 Email: davecb@canada.sun.com
ash@trellick.net wrote:> > "A. Zuercher" <aaron@otherland.pekin.net> wrote: > > scripts for each user, but this is unneccssary. Instead is > > there a group variable I could use to have staff.bat and a > > student.bat login script run according to which group the > > person is in? > > I too am trying to do this.. I have dynamic logons working from the > example in samba integrating unix and windows.. but need to get the > groups from unix so I can use them to map drives in my perl logon > script. > > if any perl deity is hanging about.. please help.This bit of code should do what you want. It takes a username as a command line argument, and returns a list of the groups that user is a member of. You can pull the username from Samba, and then chain this in to do whatever you like. #!/usr/bin/perl $username = $ARGV[0] || die "Need a username!\n"; while (($name, $passwd, $gid, $members) = getgrent) { @members = split(/\s/, $members); foreach (@members) { if (/$username/) { push(@groups,$name); } } } foreach (@groups) { print "Found user in group: $_\n"; }