[Samba] (no subject)

ciradhb.forward at laposte.net ciradhb.forward at laposte.net
Wed Apr 4 04:06:21 MDT 2012


 Hi Moray, 
 
Thanks for your answer. It could help but only partially. 
 
The script name logon%u.cmd was a bad example. Actually, a user can log on from WinXP , or Win 7 workstations, and I'like to run different logon scripts depending on the OS . So having logon script = logon%a.cmd in the smb.conf generally works thanks to variable substitution.
 
But for user accounts that have been created with the USRMGR.EXE tools, the Logon Script attributes have not been set and it seems not possible to modify it with variables using "pdbedit --script" .(one precision : I use  passdb backend = tdbsam ).

 
Your script could help , but as you said logon script name will be hardcoded for each users which I want to avoid. 


Isn't it possible to manually change some entries in the passdb.tdb file ?   
 
Henri 
 
> -----Message d'origine-----
> De : Moray Henderson [mailto:Moray.Henderson at ict-software.org]
> Envoyé : mercredi 4 avril 2012 12:56
> À : ciradhb.forward at laposte.net; samba at lists.samba.org
> Objet : RE: [Samba] macro characters with pdbedit ?
> 
> > From: ciradhb.forward at laposte.net [mailto:ciradhb.forward at laposte.net]
> > Sent: 03 April 2012 11:49
> >
> > Hi,
> >
> > I would like to change the Logon script name attributes of a samba
> > user account to something like logon%u.cmd using pdbedit with the
> > --script option. It does not work because the string logon%u.cmd is
> > litteraly taken as the value, loosing the variable substitution at
> > evaluation time. pdbedit -v output gives "Logon Script : logon%u.cmd" .
> >
> > When creating a user account without --script option, it takes by
> > default the string that is specified in the smb.conf (say :
> > logon%a.cmd) as a macro that will be evaluated later (pdbedit -v gives
> > Logon Script: logonUNKNOWN.cmd which seems normal on linux).
> >
> > So my question is :  is it possible to use macro characters with
> > pdbedit the same way they are used in the smb.conf ? If not how can I
> > change account attributes (and specifically the Logon Script Name)
> > with macro charaters ? maybe with another tool than pdbedit ?
> >
> > Thanks in advance
> >
> > Henri
> 
> You could hard-code each user name into the Logon Script using a shell script to loop through the user database and pick out the
> names:
> 
>   for u in `pdbedit -L | cut -d: -f1`; do
>     [[ $u =~ \\$ ]] && continue    # Filter out machine accounts
>     echo pdbedit -S logon_$u.cmd -u $u
>   done
> 
> If it looks like the pdbedit commands are correct, remove the "echo".
> 
> Otherwise, you could try setting --script to whatever it gets when it picks up its value from "logon script" in smb.conf.
> 
> 
> Moray.
> “To err is human; to purr, feline.”
> 
> 
> 
 


Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ?
Je crée ma boîte mail www.laposte.net


More information about the samba mailing list