running debian 3.1 "sarge" ppc and samba 3.08 I want to have my win98se computer users to have their shares automatically mapped. 1. I have read that I would use a netlogin directory and put scripts in there? 2. Does anyone know if samba has to be set up a special way ADS, wins, etc... to use the netlogin directory and it's scripts? "this server is the only smb server technology I am using" 3. Does anyone have a good example of a "netlogin" script to simply map drives, that I could see? Thank you for your help, Eric ------------------------------------------------------------ Hopevale Union Free School District: http://www.hopevale.com
> >3. Does anyone have a good example of a "netlogin" script to simply map drives, >that I could see? >Give kixtart a try, it is very flexible, and easy for mapping drives etc http://www.kixtart.org/ You will also find a big selection of demo scripts to hack for your own pleasure. Here is the section of our kixtart script that maps drives (it is called from a .bat file like "kix32 kixscript.kix"): Use S: /Delete Use S: "\\server\shared" /user:fred /Password:fred If @ERROR = 0 ? "S: mapped" Else ? "S: not mapped" EndIf Use K: /Delete Use K: "\\anotherserver\general" If @ERROR = 0 ? "K: mapped" Else ? "K: not mapped" EndIf Use T: /Delete Use T: "\\anotherserver\DataBase" If @ERROR = 0 ? "T: mapped" Else ? "T: not mapped" EndIf Use V: /Delete Use V: "\\anotherserver\@USERID" If @ERROR = 0 ? "V: mapped" Else ? "V: not mapped" EndIf Use Z: /Delete Use Z: "\\anotherserver\fred" If @ERROR = 0 ? "Z: mapped" Else ? "Z: not mapped" EndIf
Hamish wrote: > >> >> isn't that easier with the commands that are already with Windows? >> >> net use X: \\server\share /user:username\domainname password-in-plain >> >> >> Tomek >> > A lot easier, but I could not find a way to check group membership, get the current user name or modify registry settings with the available windows tools, kixtart does it all. all right. I just thought you want to make a simple drive mapping. > And its free. well, you have to donate to some organization to use it, so it's not really free. Tomek
eric@hopevale.com wrote: >> >> net use X: \\server\share /user:username\domainname password-in-plain >> > yes, that is all I want to for right now ...just automatically map a drive. Could you help me? > I have windows 98se machines that can connect to samba shares. > where do I put the batch file and how do I specify it to run when a user logs in? dunno... I use these commands in Windows 2000. but maybe in Windows 98 they are similar. try from command line: net use /? to see some help. I don't know where to put this batch file and how to authenticate users in Windows 98... but maybe you can map drives in autoexec.bat? Tomek
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.
On 1 Dec 2004 , Michael Lueck entreated about "[Samba] Re: netlogin scripts":> 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.well, you can use some free utils to fix that. I am using 'putinenv.exe' in my Win98 scripts to get what I need. I use winset.exe (off the Win98 CD) to set master environment variables and 'setenv.exe' on W2K for the same job. I have split my scripts into 2 sections. one bit is loginall.bat that is run for everyone. it is called from LGNusername.bat which then goes on to do user specific stuff. I have not tried to integrate with the unix groups tha I am using, instead I keep a separate file with settings in it which is parsed by an AWK script to generate the login scripts. this does mean that now and then I forget to correlate actual group members to the data file, but I plan to fix that sometime. At the moment the server has been up (we switched from Novell last Thursday) nearly a week so I'm not changing too much at this point -- DA Fo rsyth Network Supervisor Principal Technical Officer -- Institute for Water Research http://www.ru.ac.za/institutes/iwr/