creating batch file for logon script...

Ries van twisk rvt at dds.nl
Tue Sep 25 14:31:28 GMT 2001


Hi 

there are already a lot of good script around for doing this kind of
job.
For myself I have a modified perl script which creates a a batch file on
the fly when a user logs on to the netlogon share. It automaticly set
somr environment variables on win 98/me/95 workstations (computername,
group name, username) and detects if it needs to load some more script
depending on the username, computername or group name. Pretty is to use
and whenever I add a user to the system the script are already there
because they are created on the file. The filea are automaticly deleted
whenever ther are not needed anymore.

Ries van Twisk



Mark Montazer wrote:
> 
> Here's a script I use, granted, there's no error checking and you have to
> remember the parameters, but time is short and bosses don't ever see the
> usefulness of such things.  Just plop it in /usr/sbin or wherever your path
> points, and it'll do the rest for you.  I call it adddomuser:
> 
> ------------------------begin script--------------------------
> #!/bin/bash
> 
> useradd -c "$1 $2 $3" -d /home/$4 -g $5 -s /bin/bash $4
> 
> # format: First Name, Middle Initial, Last Name, username, group
> 
> echo "net time \\\siddhartha /set /yes" > /usr/local/samba/netlogon/$4.bat
> echo "net use h: \\\siddhartha\\$4" >> /usr/local/samba/netlogon/$4.bat
> echo "net use i: \\\siddhartha\\$5" >> /usr/local/samba/netlogon/$4.bat
> echo "net use j: \\\siddhartha\\confluence" >>
> /usr/local/samba/netlogon/$4.bat
> 
> unix2dos /usr/local/samba/netlogon/$4.bat
> chmod 777 /usr/local/samba/netlogon/$4.bat
> 
> smbpasswd -a $4
> ----------------------end script--------------------------------
> 
> Thanks,
> Mark
> 
> -----Original Message-----
> From: samba-admin at lists.samba.org [mailto:samba-admin at lists.samba.org]On
> Behalf Of Sano B Rutsen
> Sent: Tuesday, September 25, 2001 11:56 AM
> To: samba
> Subject: Re: creating batch file for logon script...
> 
> I agree with you, but then im planning to write a script that would
> automate the creation of the batch file, so that every time I have
> to add a user i dont have to manually create the file in notepad for
> all the users, just to copy it to the linux box.
> 
> This way everytime i add a user for samba, a dos formatted script is
> automatically created without leaving my linux box,(very convenient if
> I have many users).
> 
> But then again, I can see your point. Im doing this for a home network
> with no more than 20 users... hehe... Anyways, i like doing things
> for fun.
> 
> Thanx!
> 
> Best Regards,
> 
> Sano
> 
> =?iso-8859-1?Q?Wilmar_P=E9rez?= wrote:
> 
> >Hi Sano
> >
> >Well, your friend's right.  But you don't need any other program.  You
> >just've got to edit the file in a DOS or Windows plain text editor and the
> >send it to the Linux box, that's it.
> >
> >Bye
> 
> __________________________________
> www.edsamail.com
> 
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba
> 
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba




More information about the samba mailing list