[Samba] Why does this logon-script not work under Win9x ?

Khanh Tran khanh at slc.edu
Mon Aug 12 05:58:00 GMT 2002


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 at 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




More information about the samba mailing list