Harry RĂ¼ter
2002-Aug-12 05:47 UTC
[Samba] Why does this logon-script not work under Win9x ?
Hi,
i'm having a serious problem with the following logon-script.
It works under W2k, but not under W98, although W98 tells
it is running startup-script ..
First my smb.conf (only interesting parts) :
---snipp---
[global]
server string = Samba-PDC %v on %h
workgroup = WORKGROUP
encrypt passwords = yes
netbios name = 486dx66
domain master = Yes
local master = Yes
prefered master = yes
wins support = no
wins proxy = no
security = user
os level = 255
domain logons = yes
logon drive = v:
logon path = \\%N\%u\ntprofile\%a
logon home = \\%N\%u\.profiles
logon script = logonsmb.bat
log level = 1
interfaces = 192.168.1.3/255.255.255.0
dos filetime resolution = Yes
socket options = TCP_NODELAY IPTOS_LOWDELAY
bind interfaces only = Yes
strict locking = Yes
map to guest = Bad User
lprm command = /usr/bin/lprm -P%p %j
dos filetimes = Yes
create mask = 0660
preserve case = yes
short preserve case = yes
case sensitive =yes
hide unreadable = yes
[netlogon]
path= /opt/samba/netlogon
read only = yes
locking = no
public = no
writeable = no
browseable = no
root preexec = /opt/samba/netlogon/netlogon.sh %S %P %u %g %U %G \
%H %v %h %m %L %M %N %R %d %a %I %$(HOSTTYPE) %T %p
# creates the logon-script on each logon
---snipp---
Here's the logonscript (logonsmb.bat)
---snipp---
@ECHO OFF
set CURRENTSERVICE=netlogon
set ROOTDIRCURSERVICE=/opt/samba/netlogon
set USEROFCURRENTSERVICE=harry
set PRIMARYGRUOUPOFCURRENTSERVICEUSER=users
set SESSIONUSER=harry
set PRIMARYGROUPOFSESSIONUSER=users
set HOMEDIROFSERVICEUSER=/home/harry
set SAMBAVER=2.2.5
set INTERNETHOSTNAMEOFSAMBASERVER=486dx66
shift 1
set NETBIOSNAMEOFCLIENT=pentium200
shift 1
set NETBIOSNAMEOFSERVER=486dx66
shift 1
set INTERNETNAMEOFCLIENT=pentium200.hrnet.de
shift 1
set NAMEOFNISHOMEDIRSERVER=486dx66
shift 1
set PROTOCOL=NT1
shift 1
set PIDOFCURRENTSERVER=17049
shift 1
set ARCHITEKTUROFCLIENT=Win95
shift 1
set IPOFCLIENT=192.168.1.1
shift 1
set ENVAR_HOST_TYPE=i386
shift 1
set DATETIME=2002/08/12 15:53:40
@SET SERVER=%INTERNETHOSTNAMEOFSAMBASERVER%
@ECHO OFF
@echo Architektur = %ARCHITEKTUROFCLIENT%
@echo User = %USEROFCURRENTSERVICE%
REM It doesn't even stop here in W98 as if it's not called
pause
@net use >>c:\netuse.txt
@net use u: /delete > nul
@net use w: /delete > nul
@net use x: /delete > nul
@net use y: /delete > nul
REM -----------------------------------------
@if "%ARCHITEKTUROFCLIENT%" == "Win2K" goto win2k
@if "%ARCHITEKTUROFCLIENT%" == "WinNT" goto win2k
@if "%ARCHITEKTUROFCLIENT%" == "Win95" goto win95
@if "%ARCHITEKTUROFCLIENT%" == "OS2" goto OS2
@goto end
REM ------------Win2000----------------------
:Win2k
@net use /persistent:no
@NET TIME \\%Server% /SET /YES > nul
@net use u: \\%Server%\homepages > nul
@net use w: \\%Server%\fax > nul
@net use x: \\%Server%\data > nul
@if "%USEROFCURRENTSERVICE%" == "administrator" goto root
REM @if "%USEROFCURRENTSERVICE%" == "Administrator" goto
root
:win2kend
@goto end
REM -----------------------------------------
REM ----------Win9x--------------------------
:win95
echo In Win95
@NET TIME \\%Server% /SET /YES
@net use /HOME >>c:\netuse.txt
@net use u: \\%Server%\homepages
@net use w: \\%Server%\fax
@net use x: \\%Server%\data
@if "%USEROFCURRENTSERVICE%" == "administrator" goto root
REM @if "%USEROFCURRENTSERVICE%" == "Administrator" goto
root
:win95end
@goto end
REM -----------------------------------------
REM -----------OS2---------------------------
:OS2
rem echo In OS2
@NET TIME \\%Server% /SET /YES > nul
@net use u: \\%Server%\homepages > nul
@net use v: \\%Server%\homes > nul
@net use w: \\%Server%\fax > nul
@net use x: \\%Server%\data > nul
@if "%USEROFCURRENTSERVICE%" == "administrator" goto root
REM if "%USEROFCURRENTSERVICE%" == "Administrator" goto
root
:os2end
@goto end
REM -----------------------------------------
:root
@net use y: \\%Server%\rootdir$ > nul
:end
REM -----------------------------------------
@echo User %USEROFCURRENTSERVICE% has successfully mounted his/hers
shares
@pause
rem @call \\%Server%\netlogon\delme.bat %Server% > nul
REM -----------------------------------------
---snipp---
Any ieas, what's wrong ?
The script works perfectly, when copied to the W98-machine
and started there.
The script works also under W2k and OS2 ...
greets Harry
Michiel_Lange@actuera.nl
2002-Aug-12 05:54 UTC
[Samba] Why does this logon-script not work under Win9x ?
You might want to check out where the execution stops. I've encountered
hanging netlogon scripts in the past, which ran fine after some time like
miraculously... but I saw the very long variable-names.. that might be a
problem...?
Harry R?ter
<harry_rueter@gmx To: Samba-List
<samba@lists.samba.org>
.de> cc:
Sent by: Fax to:
samba-admin@lists Subject: [Samba] Why does this
logon-script not work under Win9x ?
.samba.org
12-08-2002 16:45
Hi,
i'm having a serious problem with the following logon-script.
It works under W2k, but not under W98, although W98 tells
it is running startup-script ..
First my smb.conf (only interesting parts) :
---snipp---
[global]
server string = Samba-PDC %v on %h
workgroup = WORKGROUP
encrypt passwords = yes
netbios name = 486dx66
domain master = Yes
local master = Yes
prefered master = yes
wins support = no
wins proxy = no
security = user
os level = 255
domain logons = yes
logon drive = v:
logon path = \\%N\%u\ntprofile\%a
logon home = \\%N\%u\.profiles
logon script = logonsmb.bat
log level = 1
interfaces = 192.168.1.3/255.255.255.0
dos filetime resolution = Yes
socket options = TCP_NODELAY IPTOS_LOWDELAY
bind interfaces only = Yes
strict locking = Yes
map to guest = Bad User
lprm command = /usr/bin/lprm -P%p %j
dos filetimes = Yes
create mask = 0660
preserve case = yes
short preserve case = yes
case sensitive =yes
hide unreadable = yes
[netlogon]
path= /opt/samba/netlogon
read only = yes
locking = no
public = no
writeable = no
browseable = no
root preexec = /opt/samba/netlogon/netlogon.sh %S %P %u %g %U %G \
%H %v %h %m %L %M %N %R %d %a %I %$(HOSTTYPE) %T %p
# creates the logon-script on each logon
---snipp---
Here's the logonscript (logonsmb.bat)
---snipp---
@ECHO OFF
set CURRENTSERVICE=netlogon
set ROOTDIRCURSERVICE=/opt/samba/netlogon
set USEROFCURRENTSERVICE=harry
set PRIMARYGRUOUPOFCURRENTSERVICEUSER=users
set SESSIONUSER=harry
set PRIMARYGROUPOFSESSIONUSER=users
set HOMEDIROFSERVICEUSER=/home/harry
set SAMBAVER=2.2.5
set INTERNETHOSTNAMEOFSAMBASERVER=486dx66
shift 1
set NETBIOSNAMEOFCLIENT=pentium200
shift 1
set NETBIOSNAMEOFSERVER=486dx66
shift 1
set INTERNETNAMEOFCLIENT=pentium200.hrnet.de
shift 1
set NAMEOFNISHOMEDIRSERVER=486dx66
shift 1
set PROTOCOL=NT1
shift 1
set PIDOFCURRENTSERVER=17049
shift 1
set ARCHITEKTUROFCLIENT=Win95
shift 1
set IPOFCLIENT=192.168.1.1
shift 1
set ENVAR_HOST_TYPE=i386
shift 1
set DATETIME=2002/08/12 15:53:40
@SET SERVER=%INTERNETHOSTNAMEOFSAMBASERVER%
@ECHO OFF
@echo Architektur = %ARCHITEKTUROFCLIENT%
@echo User = %USEROFCURRENTSERVICE%
REM It doesn't even stop here in W98 as if it's not called
pause
@net use >>c:\netuse.txt
@net use u: /delete > nul
@net use w: /delete > nul
@net use x: /delete > nul
@net use y: /delete > nul
REM -----------------------------------------
@if "%ARCHITEKTUROFCLIENT%" == "Win2K" goto win2k
@if "%ARCHITEKTUROFCLIENT%" == "WinNT" goto win2k
@if "%ARCHITEKTUROFCLIENT%" == "Win95" goto win95
@if "%ARCHITEKTUROFCLIENT%" == "OS2" goto OS2
@goto end
REM ------------Win2000----------------------
:Win2k
@net use /persistent:no
@NET TIME \\%Server% /SET /YES > nul
@net use u: \\%Server%\homepages > nul
@net use w: \\%Server%\fax > nul
@net use x: \\%Server%\data > nul
@if "%USEROFCURRENTSERVICE%" == "administrator" goto root
REM @if "%USEROFCURRENTSERVICE%" == "Administrator" goto
root
:win2kend
@goto end
REM -----------------------------------------
REM ----------Win9x--------------------------
:win95
echo In Win95
@NET TIME \\%Server% /SET /YES
@net use /HOME >>c:\netuse.txt
@net use u: \\%Server%\homepages
@net use w: \\%Server%\fax
@net use x: \\%Server%\data
@if "%USEROFCURRENTSERVICE%" == "administrator" goto root
REM @if "%USEROFCURRENTSERVICE%" == "Administrator" goto
root
:win95end
@goto end
REM -----------------------------------------
REM -----------OS2---------------------------
:OS2
rem echo In OS2
@NET TIME \\%Server% /SET /YES > nul
@net use u: \\%Server%\homepages > nul
@net use v: \\%Server%\homes > nul
@net use w: \\%Server%\fax > nul
@net use x: \\%Server%\data > nul
@if "%USEROFCURRENTSERVICE%" == "administrator" goto root
REM if "%USEROFCURRENTSERVICE%" == "Administrator" goto
root
:os2end
@goto end
REM -----------------------------------------
:root
@net use y: \\%Server%\rootdir$ > nul
:end
REM -----------------------------------------
@echo User %USEROFCURRENTSERVICE% has successfully mounted his/hers
shares
@pause
rem @call \\%Server%\netlogon\delme.bat %Server% > nul
REM -----------------------------------------
---snipp---
Any ieas, what's wrong ?
The script works perfectly, when copied to the W98-machine
and started there.
The script works also under W2k and OS2 ...
greets Harry
--
To unsubscribe from this list go to the following URL and read the
instructions: http://lists.samba.org/mailman/listinfo/samba
Chris Smith
2002-Aug-12 05:56 UTC
[Samba] Why does this logon-script not work under Win9x ?
The usual problem when a script runs under an NT based OS and not a DOS based OS is line termination. It seems that NT based systems are less sensitive to proper DOS line termination than DOS based systems. Chris -- 'Nix MS - Just Say .NyET
Khanh Tran
2002-Aug-12 05:58 UTC
[Samba] Why does this logon-script not work under Win9x ?
Anyone here is welcome to tell me I'm wrong, but I don't think that
Win98
will set your variables:
set CURRENTSERVICE=netlogon
set ROOTDIRCURSERVICE=/opt/samba/netlogon
set USEROFCURRENTSERVICE=harry
set PRIMARYGRUOUPOFCURRENTSERVICEUSER=users
set SESSIONUSER=harry
set PRIMARYGROUPOFSESSIONUSER=users
set HOMEDIROFSERVICEUSER=/home/harry
I won't quote the rest, but I believe that Win98 will attempt to actually
locate the paths you are setting, and being that those don't exist under a
Win98 filesystem, it will come back with errors. The W2k machines probably
work because they'll just set the variables to whatever you want, despite
their validity.
Also, it could just be how you are creating the logon script under Unix and
DOS doesn't like the line breaks.
Khanh Tran
Network Operations
Sarah Lawrence College
1 Mead Way
Bronxville, NY 10708
-----Original Message-----
From: Harry R?ter [mailto:harry_rueter@gmx.de]
Sent: Monday, August 12, 2002 10:46 AM
To: Samba-List
Subject: [Samba] Why does this logon-script not work under Win9x ?
Hi,
i'm having a serious problem with the following logon-script.
It works under W2k, but not under W98, although W98 tells
it is running startup-script ..
First my smb.conf (only interesting parts) :
---snipp---
[global]
server string = Samba-PDC %v on %h
workgroup = WORKGROUP
encrypt passwords = yes
netbios name = 486dx66
domain master = Yes
local master = Yes
prefered master = yes
wins support = no
wins proxy = no
security = user
os level = 255
domain logons = yes
logon drive = v:
logon path = \\%N\%u\ntprofile\%a
logon home = \\%N\%u\.profiles
logon script = logonsmb.bat
log level = 1
interfaces = 192.168.1.3/255.255.255.0
dos filetime resolution = Yes
socket options = TCP_NODELAY IPTOS_LOWDELAY
bind interfaces only = Yes
strict locking = Yes
map to guest = Bad User
lprm command = /usr/bin/lprm -P%p %j
dos filetimes = Yes
create mask = 0660
preserve case = yes
short preserve case = yes
case sensitive =yes
hide unreadable = yes
[netlogon]
path= /opt/samba/netlogon
read only = yes
locking = no
public = no
writeable = no
browseable = no
root preexec = /opt/samba/netlogon/netlogon.sh %S %P %u %g %U %G \
%H %v %h %m %L %M %N %R %d %a %I %$(HOSTTYPE) %T %p
# creates the logon-script on each logon
---snipp---
Here's the logonscript (logonsmb.bat)
---snipp---
@ECHO OFF
set CURRENTSERVICE=netlogon
set ROOTDIRCURSERVICE=/opt/samba/netlogon
set USEROFCURRENTSERVICE=harry
set PRIMARYGRUOUPOFCURRENTSERVICEUSER=users
set SESSIONUSER=harry
set PRIMARYGROUPOFSESSIONUSER=users
set HOMEDIROFSERVICEUSER=/home/harry
set SAMBAVER=2.2.5
set INTERNETHOSTNAMEOFSAMBASERVER=486dx66
shift 1
set NETBIOSNAMEOFCLIENT=pentium200
shift 1
set NETBIOSNAMEOFSERVER=486dx66
shift 1
set INTERNETNAMEOFCLIENT=pentium200.hrnet.de
shift 1
set NAMEOFNISHOMEDIRSERVER=486dx66
shift 1
set PROTOCOL=NT1
shift 1
set PIDOFCURRENTSERVER=17049
shift 1
set ARCHITEKTUROFCLIENT=Win95
shift 1
set IPOFCLIENT=192.168.1.1
shift 1
set ENVAR_HOST_TYPE=i386
shift 1
set DATETIME=2002/08/12 15:53:40
@SET SERVER=%INTERNETHOSTNAMEOFSAMBASERVER%
@ECHO OFF
@echo Architektur = %ARCHITEKTUROFCLIENT%
@echo User = %USEROFCURRENTSERVICE%
REM It doesn't even stop here in W98 as if it's not called
pause
@net use >>c:\netuse.txt
@net use u: /delete > nul
@net use w: /delete > nul
@net use x: /delete > nul
@net use y: /delete > nul
REM -----------------------------------------
@if "%ARCHITEKTUROFCLIENT%" == "Win2K" goto win2k
@if "%ARCHITEKTUROFCLIENT%" == "WinNT" goto win2k
@if "%ARCHITEKTUROFCLIENT%" == "Win95" goto win95
@if "%ARCHITEKTUROFCLIENT%" == "OS2" goto OS2
@goto end
REM ------------Win2000----------------------
:Win2k
@net use /persistent:no
@NET TIME \\%Server% /SET /YES > nul
@net use u: \\%Server%\homepages > nul
@net use w: \\%Server%\fax > nul
@net use x: \\%Server%\data > nul
@if "%USEROFCURRENTSERVICE%" == "administrator" goto root
REM @if "%USEROFCURRENTSERVICE%" == "Administrator" goto
root
:win2kend
@goto end
REM -----------------------------------------
REM ----------Win9x--------------------------
:win95
echo In Win95
@NET TIME \\%Server% /SET /YES
@net use /HOME >>c:\netuse.txt
@net use u: \\%Server%\homepages
@net use w: \\%Server%\fax
@net use x: \\%Server%\data
@if "%USEROFCURRENTSERVICE%" == "administrator" goto root
REM @if "%USEROFCURRENTSERVICE%" == "Administrator" goto
root
:win95end
@goto end
REM -----------------------------------------
REM -----------OS2---------------------------
:OS2
rem echo In OS2
@NET TIME \\%Server% /SET /YES > nul
@net use u: \\%Server%\homepages > nul
@net use v: \\%Server%\homes > nul
@net use w: \\%Server%\fax > nul
@net use x: \\%Server%\data > nul
@if "%USEROFCURRENTSERVICE%" == "administrator" goto root
REM if "%USEROFCURRENTSERVICE%" == "Administrator" goto
root
:os2end
@goto end
REM -----------------------------------------
:root
@net use y: \\%Server%\rootdir$ > nul
:end
REM -----------------------------------------
@echo User %USEROFCURRENTSERVICE% has successfully mounted his/hers
shares
@pause
rem @call \\%Server%\netlogon\delme.bat %Server% > nul
REM -----------------------------------------
---snipp---
Any ieas, what's wrong ?
The script works perfectly, when copied to the W98-machine
and started there.
The script works also under W2k and OS2 ...
greets Harry
--
To unsubscribe from this list go to the following URL and read the
instructions: http://lists.samba.org/mailman/listinfo/samba
Mathias Homann
2002-Aug-12 09:35 UTC
[Samba] Why does this logon-script not work under Win9x ?
Am Montag, 12. August 2002 16:57 schrieb Chris Smith:> The usual problem when a script runs under an NT based OS and not a DOS > based OS is line termination. It seems that NT based systems are less > sensitive to proper DOS line termination than DOS based systems.I have the very same problem here, a netlogon script that runs fine when logging in from a NT based WS (WinXP here) but refuses to when logging in from W98. and I created the logon script on linux and converted it with unix2dos so the line endings should be ok. bye, MH
Rainer Schoenen
2002-Aug-12 12:18 UTC
[Samba] Why does this logon-script not work under Win9x ?
I guess the environment space is exhausted. Once upon a time, DOS had a limitation in the number of characters in the environment buffer. It was 512 bytes by default. I remember having experienced similar problems with Win95-98. Under DOS this could be changed by calling something like command.exe /E:1024 in your config.sys Maybe it can be changed by executing "msconfig". ---snipp--- @ECHO OFF set CURRENTSERVICE=3Dnetlogon set ROOTDIRCURSERVICE=3D/opt/samba/netlogon set USEROFCURRENTSERVICE=3Dharry set PRIMARYGRUOUPOFCURRENTSERVICEUSER=3Dusers set SESSIONUSER=3Dharry set PRIMARYGROUPOFSESSIONUSER=3Dusers set HOMEDIROFSERVICEUSER=3D/home/harry set SAMBAVER=3D2.2.5 set INTERNETHOSTNAMEOFSAMBASERVER=3D486dx66 shift 1 set NETBIOSNAMEOFCLIENT=3Dpentium200 shift 1 set NETBIOSNAMEOFSERVER=3D486dx66 shift 1 set INTERNETNAMEOFCLIENT=3Dpentium200.hrnet.de shift 1 set NAMEOFNISHOMEDIRSERVER=3D486dx66 shift 1 set PROTOCOL=3DNT1 shift 1 set PIDOFCURRENTSERVER=3D17049 shift 1 set ARCHITEKTUROFCLIENT=3DWin95 shift 1 set IPOFCLIENT=3D192.168.1.1 shift 1 set ENVAR_HOST_TYPE=3Di386 shift 1 set DATETIME=3D2002/08/12 15:53:40 @SET SERVER=3D%INTERNETHOSTNAMEOFSAMBASERVER%