Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon script

Status
Not open for further replies.

acidbrain

Technical User
Sep 2, 2002
67
RO
Hi there,
I'm trying to set up a samba server but can't make win95 map the drive i specify.
The logon script looks like this:

REM NETLOGON.BAT
net use Z: \\Server\testare /yes

"Server" is samba and "testare" the directory created to do the map on it, PC name is "test". When win95 starts in a splash screen says that it tries to read the logon script, after it's been read windows starts up without no network map (the one i specified in the test.bat -> being the logon script in /home/samba/netlogon. I named the script after the Pc's name.) The script is read but i can see no mapping. Why?!
Any ideeas? :)
Thanks alot,
 
If you go to your 95 pc, run the following from a command prompt.

net use Z: \\Server\testare /yes

Do you get the mapping now? If not, the error is not with the script, but with the fact 95 cannot complete the command.

Matt J.
 
I did what you said and it really works, my desired mapping was made. Now i'm trying to figure out where the problem might be and why my win95 doesn't want to make that mapping using the logon script.
Thanks for the tip :)
 
# Global parameters
[global]
workgroup = Gliga_companies
netbios name = Server
server string = Samba %v on (%L)
encrypt passwords = Yes
map to guest = Bad user
passwd program = /usr/bin/passwd
unix password sync = Yes
max log size = 50
time server = Yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
logon script = netlogon.bat
domain logons = Yes
logon script = %U.bat
path = /home/samba/hetlogon
os level = 64
lm announce = True
preferred master = True
domain master = True
dns proxy = No
printing = cups
domain admin group = @adm
username map = /etc/samba/smbusers
load printers = yes
hosts allow=10.0.0. 10.0.0.253 localhost
hosts deny=10.0.0.254
local master = yes[public]
comment = Folder public
browseable = yes
printable = no
create mode=0664
[testare]
comment = director testare
path = /home/samba/samba
browseable = yes
[homes]
comment = Home Directories
path = /home/%u
read only = No
create mode=0664
[hp1200]
printer = HP_1200
comment = HP_laserjet_1200
printable = yes
path = /var/spool/samba

[netlogon]
comment = Network logon service
path = /home/samba/netlogon
browseable=no
printable=no
guest ok = yes
public = no
writable = no
[samba]
comment = login tracking share
path = /home/samba/samba
browseable = No
root preexec = /usr/local/bin/netlogon.sh %u %I
root postexec = /usr/local/bin/netlogoff.sh %u
[public]
comment = Folder public
browseable = yes
printable = no
create mode=0664
[testare]
comment = director testare
path = /home/samba/samba
browseable = yes
 
oops.. i made a mistake. Testare appears twice here but in my smb.conf not. There's right, only once.
 
One thing that I noticed that may be problematic is in the global section of smb.conf you have:

encrypt passwords = Yes

I don't believe that win95 can encrypt passwords. That being said, I'm not sure why it would work when manually typing the 'net use' command mentioned above on the win95 machine.
 
I tried "encrypt password = no" but still no use. I did instead this in my netlogon.bat:
"net use f: \\server\contabilitate /yes >c:\log.txt
Now my desired map is done without any trouble. I wonder why did i have to add that log.txt and why didn't i see this option in no tutorial ?!
 
Acid (and anyone else for that matter):

Win9x machines tyically use 'Z' drive as ~the drive letter~ that the vdm (Virtual Dos Machine) uses while a logon script is running. In other words - you're trying to map a drive that the win9x client has already grabbed - isn't gonna happen.

Test and verify this: update you're logon script so that it has a net use in it and then a pause, ie:

*** Acid's cool logon script ***
@echo off
net use i: \\someserver\install
net use s: \\someotherserver\share
cls
net use
pause
more of acids cool script...

*********************************

The pause statement should stop the script and echo out to the screen what the current drive mapping is - 10-1 says that 'Z' is already mapped.

Pick another drive letter and use that.

(you will, on the other hand, be able to map 'Z' on an NT or greater machine - they can run thier scripts unc'd... )

HTH...


-=- jd -=-
 
U'r damn right with that "Z" :) All logon scripts work, i didn't use any "Z" map letter. The next step i'm workin on are policies. I want to set user rights using the windows's poledit. Didn't figure out how, yet but i'm workin on it as i said.
thanks for your help guys :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top