[Samba] logon script

Miguel Medalha miguelmedalha at sapo.pt
Sun May 31 00:59:30 GMT 2009

> I have configured a samba PDC with a logon script. The logon script includes
> dos commands to map a drive letter for different shares. One share has user
> home directory, one has common folder for all the users and other share is
> group share. For assigning a drive letter to group share I have used the
> command "net use g: \\%L\group\%G" but group share drive is not mounting for
> any of the users. I have three groups tech,mktg and sales. I want to mount
> tech share for tech group and that particular share only should be mounted
> as group share for tech group users and same for mktg and sales. Can you
> please help me out in solving this issue. please assist me in giving correct
> parameters and path.

Put the following parameter in your smb.conf:

logon script = %G.bat

Then, create a script named after each group in your "netlogon" share, 
in your case "tech.bat", "mktg.bat" and "sales.bat".

The script corresponding to the group the particular user belongs to will be executed upon logon.

To map the shares to drives, the script should contain commands in the folllowing format:

net use g: \\server\sharename

(The drive letter to use depends, of course, on your particular case).

See "Variable substitutions" on the smb.conf man page.

More information about the samba mailing list