[Samba] logon script

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


Hi,

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:

<....snip....>
\\%SERVER01%\netlogon\ifmember.exe /verbose tech 
if errorlevel 1 goto TECH
:STOPTECH

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

goto END

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

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

:END
rem This is the End of your script

<...snip...>

Cheers,

Christian

===========================================================
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

>Hi,
>
>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.
>
>Thank You.
>Regards,
>Santy
>-- 
>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