[Samba] logon script

Christian Rost cr at rocon-it.de
Mon Jun 1 10:09:59 GMT 2009


you don't have access to Samba variables from within your logon script. The most convenient way to solve this is by using the "ifmember.exe" executable from the Windows Server 2003 toolkit and to place it into your netlogon share - you need to google for ifmember.

With ifmember.exe you can test, if the user who is running the logon script, belongs to the specified group. Use the following lines as an example and add it to your logon script:

\\%SERVER01%\netlogon\ifmember.exe /verbose tech 
if errorlevel 1 goto TECH

\\%SERVER01%\netlogon\ifmember.exe /verbose mktg 
if errorlevel 1 goto MKTG

goto END

## TECH group 
if exist k:\nul net use /delete k: /yes
if not exist k:\nul net use k: \\%SERVER01%\tech /persistent:no

## MKTG group 
if exist l:\nul net use /delete l: /yes
if not exist l:\nul net use l: \\%SERVER01%\tech /persistent:no

rem This is the End of your script




Christian Rost
roCon - Informationstechnologie
Glatzer Weg 4

44534 Lünen

fon: +49 (0) 2306 910 658
fax: +49 (0) 2306 910 664
url: http://www.rocon-it.de

--------Santhosh Kumar Gulla <santy4linux at gmail.com> wrote--------
Subject: [Samba] logon script
Date: 31.05.2009 00:35

>I have configured a samba PDC with a logon script. The logon script
>dos commands to map a drive letter for different shares. One share has
>home directory, one has common folder for all the users and other share
>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
>any of the users. I have three groups tech,mktg and sales. I want to
>tech share for tech group and that particular share only should be
>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
>parameters and path.
>Thank You.
>To unsubscribe from this list go to the following URL and read the
>instructions:  https://lists.samba.org/mailman/options/samba

More information about the samba mailing list