[Samba] Re: netlogin scripts

Michael Lueck mlueck at lueckdatasystems.com
Wed Dec 1 21:28:54 GMT 2004


I would suggest something like this for your smb.conf...

# /etc/samba/smb.conf
[global]
########## NT Domain Related ##########
logon script = LOGON.BAT
logon drive = I:
logon path =
######## File Shares ########
[netlogon]
comment = Network Logon Service
browseable = no
path = /shares/netlogon/%a
locking = no
guest ok = no
read only = yes
write list = @domadmin

The %a makes the netlogon share OS specific so you don't have to sense the OS in a global LOGON.BAT, you get one per OS. To find out what your OS sends in as the OS string, I made %a part of the log 
filename and the saw what was the OS string from that filename... then put the logging back to normal. The MS client for DOS reports "WfWg" and Windows 2000 reports "Win2K" as examples.

When the LOGON.BAT runs, the user has authenticated (obiviously since they are able to access files on the server) so you can simply put some NET USE commands in the LOGON.BAT w/o ID/pw and the 
credentials of the logged in user will be used. For example...

REM LOGON.BAT for DOS
@ECHO OFF
NET TIME /SET /YES
NET USE U: LDSTST02\STAGE

You do not get vars set in DOS with things like the server name, so alas it must be hard coded into LOGON.BAT. You could set an EnvVar at the top of the bat file and use it throughout the drive mappings.

-- 
Michael Lueck
Lueck Data Systems

Remove the upper case letters NOSPAM to contact me directly.



More information about the samba mailing list