[Samba] SAMBA-LDAP and variable substition

Harry Rüter harry_rueter at gmx.de
Wed Jun 26 05:31:03 GMT 2002


Hi,

werner maes wrote:
> 
> werner maes wrote:
>  >
>  > Hello,
>  >
>  > Im using Samba and LDAP together and if I use the scriptPath attribute for
>  > a user defined in LDAP, it seems that variable substitions no longer work
>  > like they did when you're using the global logon script parameter in
> smb.conf.
>  >
>  > example:
>  >
>  > scriptPath = scripts\%m.bat ==> %m.bat is NOT substituted to
> machinename.bat
>  >
>  > Because the "logon scripts" directive of smb.conf will no longer be used
>  > when using Samba and LDAP together, I'm wondering how I can take advantage
>  > of variable substition?
>  >
>  > Or am I missing something?
> 
>  >> I think there is another misconfiguration,
>  >> i'm using Samba 2.2.4 & openldap 2.0.25 and
>  >> the substitution works (I use logon script = %u.bat).
>  >> I looked into man smb.conf and found no
>  >> scriptPath entry ..
>  >> have you tried testparm ?
>  >> greets Harry
> 
> I shall make myself more clear.
> The scriptPath entry is an attribute for the sambaAccount objectclass in
> LDAP. Here you can define the location of the logon script for each user in
> LDAP. In fact, I have no problem with Win9x machines (which do not seem to
> use the scriptPath attribute but rather the general "logon script"
> directive in smb.conf) but with an WinXP client the variable substition
> does NOT seem to work. If I don't use variables in the scriptPath attribute
> then the logon script is executed.
> 
> So: scriptPath= scripts\%m.bat ==> does not work
>        scriptPath = scripts\pc.bat ==> works
> 
> The scriptPath attribute is defined for the user as well for the machine
> account.
> 
> Any ideas?

Have you looked into the logfiles ?
Are you sure, that samba does variable substition
on the value it gets from LDAP ?

Why don't you use logon script = scripts\%m\pc.bat ?

This will do it too ...

You can do anything with the "logon script"-entry ,
specifying per user and per machine and per OS !!!

example :
 
logon script scripts\%m\%u\%a\pc.bat 

If xou're using Winxp, user is werner, machine is mymachine 
it would be :

logon script scripts\mymachine\werner\win2K\pc.bat

> Werner Maes
> KULeuven

greets Harry




More information about the samba mailing list