[Samba] Samba PDC and User Management with Perl scripts

John Benedetto jbenedet at unm.edu
Wed Feb 20 09:33:05 GMT 2002


--On Wednesday, February 20, 2002 9:08 AM +0100 Umberto Nicoletti 
<unicoletti at arpa.veneto.it> wrote:

> My problem is that alla users have primary group set to users or
> something like that, so it doesn't help much.
>
>> A another way is a "root preexec=<shell script> %U %G ...." for the
>> netlogon share to generate the netlogon scripts for the clients. This
>> script must generate a client style bat or cmd file like
>> <username>.cmd , which was called by the "logon script=<username>.cmd"
>> parameter.
>> Like:        netlogon LOGONSERVER\<Group_Share>
>>         and so on ...
>> The netlogon script must have CR LF at any end of a line!
>
> But would it be generated in time for the client to read it?
> Also this does not sound portable...I mean in a pure (well, actually it
> is polluted by M$ itself) NT environment user and group enum would work,
> hence also my script would.
>
> Anyway it's better than nothing...
>
> I think I'll simply create logon scripts periodically out of a cron job
> with a shell script or so, so that each user gets its custom logon
> script which is spawned from the main logon.bat that is set for eveybody
> at domain level.

You *can* do a dynamically generated logon batch file... you can find 
_some_ info at http://www.phonax.com/fileservers/index.shtml and more info 
in print in "Using Samba" by Richard Sharpe.

Basically a perl script executes on the server at login time, creates the 
.bat file (don't forget the CR/LF) and sends it to the client to be 
executed there.

- john




More information about the samba mailing list