[Samba] Logon Script

Maartin dinamite at ibi.co.za
Sat Aug 24 04:48:01 GMT 2002

      The netlogon option page 11 of 12

The final piece we're going to add to smb.conf (well, at least for now... )
is the logon script option. Like the [homes] and [profile] shares, there are
two pieces to the puzzle:

	logon script = netlogon.bat

# === shares ===
	path = /home/netlogon
	read only = yes
	write list = tom

The [netlogon] share is administrative tool used primarily for globally
updating client machines with items like registry patches, anti-virus
updates, program updates, etc. Anything you want to "push" out to the
client, can be done via netlogon. In addition, you can use the share to
enforce a system policy on a client or clients or perhaps backup a select
group of files every time the user logs on. Creating scripts to run from
netlogon is beyond the scope of this tutorial, but you'll find plenty of
information on the Samba.org site and by searching Google with the string
"samba scripting".

Here's how netlogon works: Any time a user logon onto the PDC and the logon
script = option and [netlogon] share are present, Samba goes to the
indicated path and executes the file referenced by logon script. Once again,
some brief caveats are in order:

  a.. The file referenced by logon script can be called anything as long as
Windows recognizes it as an executable file.
  b.. If the file referenced is not found, Samba continues on its merry way
and connects the user to the requested share(s).
  c.. Be sure to set the UNIX-side permissions to executable.
  d.. To delegate responsibility for scripts in the netlogon share, create
an "admin" group and add this group to the write list = option in the form:
write list = @admin (the '@' notation signifies a group).
  e.. Be sure to test your scripts thoroughly in a non-production
environment. Trashing the registry on 600 client machines is not a good
career move.
Extract from IBM on how to setup a PDC,
I hope this help you a bit.


----- Original Message -----
From: "Paul Soulek" <soulek at frontiernet.net>
Cc: <samba at lists.samba.org>
Sent: Saturday, August 24, 2002 4:57 AM
Subject: Re: [Samba] Logon Script

> OOPS---I see I sent this privately when I meant to send it to the list.
> ---------------------------
> I'm not sure if I explained part of my problem before. I've know that
> there is a way to have the server "run" the script---pass it along to
> the client whenever they login. Right now, I have the script stored on
> the server in /netlogon/loginsc.bat. Then I went into
> Start--Settings--Taskbar and added a shortcut to
> \\SERVERNAME\netlogon\loginsc.bat in the startup---so whenever someone
> logs in, the script will automatically map their drives. Two of these
> drives are non-user specific, and one drive is the "home" folder. This
> folder is the name of the user. Oops...you already know that...
> The main point that I wanted to make sure everyone got, is that I'm not
> running this script from the server. The script is STORED on the server,
> but the Windows machine is the one that determines when it is done. I've
> read the articles on adding the lines to the configuration file,
> creating other directories, and specifying things. Everyone on the
> network will use the SAME login script. Everyone has a home drive (H:),
> and everyone also has the two public drives (R: and S:).
> Sorry if I went over something that you already knew about my
> situation----just wanted to be sure.
> And a BIG thank you for all of the help that I've received so far---I'm
> very happy that Linux/SAMBA is the combination that we chose. Once I
> spent a bit of time getting comfortable with particular functions, they
> seem to go quite well.
> Thanks again!
> Paul
> Jay Ts wrote:
> >
> > On Fri, Aug 23, 2002 at 03:52:28PM -0700, Barry deFreese wrote:
> > >
> > > One thing that you can to is set their home directory in the
> > > users profile and then do a net use h: /home.
> >
> > You just need two things. Along with "net use h: /home" in the logon.bat
> > file, add this line to the smb.conf file:
> >
> >         [global]
> >                 logon home = \\your-server's-NetBIOS-name\%u
> >
> > That is what set's the Windows home directory location on the
> > Samba server.
> >
> > Jay Ts
> > author, Using Samba, 2nd edition
> --
> 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