use two different login scripts?

Hello,

I am pretty new to Suse and linux in general. I have a faculty group and a staff group in LDAP and these point to a login script that is defined in my smb.config. Is there a way to point these two different groups to two different login scripts so there network drives map differently?

Hi gfellerj,

[QUOTE=gfellerj;20417]Hello,

I am pretty new to Suse and linux in general. I have a faculty group and a staff group in LDAP and these point to a login script that is defined in my smb.config. Is there a way to point these two different groups to two different login scripts so there network drives map differently?[/QUOTE]

“man smb.conf” shows me:

[QUOTE]These substitutions are mostly noted in the descriptions below, but there are some general substitutions which apply whenever they might be relevant. These are:

   %U
       session username (the username that the client wanted, not necessarily the same as the one they got).

   %G
       primary group name of %U.[/QUOTE]

and

[QUOTE] logon script (G)

       This parameter specifies the batch file (.bat) or NT command file (.cmd) to be downloaded and run on a machine when a user successfully logs in. The file must contain the DOS style CR/LF line endings. Using a DOS-style
       editor to create the file is recommended.

       The script must be a relative path to the [netlogon] service. If the [netlogon] service specifies a path of /usr/local/samba/netlogon, and logon script = STARTUP.BAT, then the file that will be downloaded is:

                /usr/local/samba/netlogon/STARTUP.BAT

       The contents of the batch file are entirely your choice. A suggested command would be to add NET TIME \\\\SERVER /SET /YES, to force every machine to synchronize clocks with the same time server. Another use would be to
       add NET USE U: \\\\SERVER\\UTILS for commonly used utilities, or

           NET USE Q: \\\\SERVER\\ISO9001_QA

       for example.

       Note that it is particularly important not to allow write access to the [netlogon] share, or to grant users write permission on the batch files in a secure environment, as this would allow the batch files to be
       arbitrarily modified and security to be breached.

       This option takes the standard substitutions, allowing you to have separate logon scripts for each user or machine.

       This option is only useful if Samba is set up as a logon server.

       Default: logon script =

       Example: logon script = scripts\\%U.bat[/QUOTE]

So if you use %G in the logon script name, you can reference group-specific scripts.

Regards,
Jens

I think I may get the jist but not entirely. Right now in my smb.conf I just have this

logon script = logon.bat

which points to my batch file in my netlogon share for all users.

So I could do something like logon script = %G.bat

and then match the group names to the login script names for each group?

Hi gfellerj,

So I could do something like logon script = %G.bat
and then match the group names to the login script names for each group?

yes, that’s how I read it, too.

Regards,
Jens