yes, we are using %g in the mapping of primary group based f drives, but these scripts I want to run I don't want to base on primary group. -----Original Message----- From: Mike Rees [mailto:samba@glanymor.carms.sch.uk] Sent: Thursday, September 27, 2001 5:40 AM To: barry@arhosting.com Subject: Re:IF MEMBER OF "GROUP" THEN Barry You can specify the file that is executed when a user logs on in smb.conf. logon script = logon.bat This normally resides in the netlogon share on the server. Instead of using a specific file you can pass a parameter too. logon script = %g.bat (This passes the primary group of the user) So user Mr History from group teacher would execute teacher.bat and Miss Secretary from group staff would execute staff.bat. In our setup we first execute group scripts using the above, within this batch file we check for the existence of a file called user.bat(make these read only) in the user's home directory (after mounting it) so that we can set up individual settings. Try these http://www.oreilly.com/catalog/samba/chapter/book/ch06_06.html http://www.deschner.de/gd/dual_samba.html Hope this helps Mike ----- Original Message ----- From: "Barry Smoke" <barry@arhosting.com> To: <samba@lists.samba.org>; "Lrlug-Discuss@Lrlug. Org" <lrlug- discuss@lrlug.org> Sent: 26 September 2001 22:06 Subject: IF MEMBER OF "GROUP" THEN> IF MEMBER OF "GROUP" THEN > I have seen these types of login scripts on novell servers before, but itis> a dos command.... > is there any way to get this type of script to work under samba? > How does dos check to see what groups a logged in user is a member of? > What Variables if any does samba pass to the win9x client to set these? > > Thanks, > Barry Smoke > Network Administrator > Bryant Public Schools > > > -- > To unsubscribe from this list go to the following URL and read the > instructions: http://lists.samba.org/mailman/listinfo/samba >--------------------------------------------- This message was sent using Endymion MailMan. http://www.endymion.com/products/mailman/
I created a workaround for this for a school network (using RH6.2, Samba 2.0.7 & Win9x clients) For the netlogon share I used a preexec script that created a temporary textfile in the homes share groups > grouplist.txt I used the netlogon share because it was always accessed when a user logged on A postexec script deleted the grouplist.txt file afterwards I then created a small (dos) exe program that ran in the login script and interrogated the grouplist.txt file for specific groups as needed and used return values to indicate true or false. The login script used lines such as (dos exe) "Groupname beingchecked" IF ERRORLEVEL !=1 GOTO ... to provide the conditional jumps While not particularly elegant it works reliably (and has for the last 8 months). If it helps I can send more detail including copies of the dos exe source code etc etc. If there are better (or more elegant) ways of doing this I would be interested as well :-) Richard Smart At 16:06 26/09/01 -0500, you wrote:>IF MEMBER OF "GROUP" THEN >I have seen these types of login scripts on novell servers before, but it is >a dos command.... >is there any way to get this type of script to work under samba? >How does dos check to see what groups a logged in user is a member of? >What Variables if any does samba pass to the win9x client to set these? > >Thanks, >Barry Smoke >Network Administrator >Bryant Public Schools > > >-- >To unsubscribe from this list go to the following URL and read the >instructions: http://lists.samba.org/mailman/listinfo/samba > >
Hi, There is an MS application called IFMEMBER.EXE (available in NT Resource Kit I guess) that will do that job for you. You put it in the netlogon share and add entries to the logon script. Here's an example: ----------------<--------------------- %logonserver%\netlogon\ifmember "domain group 1" if not errorlevel 1 goto a net use x: \\server\share goto quit :a %logonserver%\netlogon\ifmember "domain group 2" if not errorlevel 1 goto b net use x: \\server\share goto quit :b %logonserver%\netlogon\ifmember "domain group 3" if not errorlevel 1 goto quit net use x: \\server\share :quit ----------------<--------------------- And so on... I am not sure if this will work if your PDC is a Samba server. cheers Gustavo> -----Original Message----- > From: Richard Smart [mailto:rsmart@netaccess.co.nz] > Sent: quinta-feira, 27 de setembro de 2001 10:22 > To: samba@lists.samba.org > Subject: Re: IF MEMBER OF "GROUP" THEN > > > I created a workaround for this for a school network (using > RH6.2, Samba > 2.0.7 & Win9x clients) > > For the netlogon share I used a preexec script that created a > temporary > textfile in the homes share > > groups > grouplist.txt > > I used the netlogon share because it was always accessed when > a user logged on > > A postexec script deleted the grouplist.txt file afterwards > > I then created a small (dos) exe program that ran in the > login script and > interrogated the grouplist.txt file for specific groups as > needed and used > return values to indicate true or false. The login script > used lines such as > > (dos exe) "Groupname beingchecked" > IF ERRORLEVEL !=1 GOTO ... to provide the conditional jumps > > While not particularly elegant it works reliably (and has for > the last 8 > months). If it helps I can send more detail including copies > of the dos exe > source code etc etc. If there are better (or more elegant) > ways of doing > this I would be interested as well :-) > > Richard Smart > > At 16:06 26/09/01 -0500, you wrote: > >IF MEMBER OF "GROUP" THEN > >I have seen these types of login scripts on novell servers > before, but it is > >a dos command.... > >is there any way to get this type of script to work under samba? > >How does dos check to see what groups a logged in user is a > member of? > >What Variables if any does samba pass to the win9x client to > set these? > > > >Thanks, > >Barry Smoke > >Network Administrator > >Bryant Public Schools > > > > > >-- > >To unsubscribe from this list go to the following URL and read the > >instructions: http://lists.samba.org/mailman/listinfo/samba > > > > > > > -- > To unsubscribe from this list go to the following URL and read the > instructions: http://lists.samba.org/mailman/listinfo/samba >