Koozali.org: home of the SME Server

No mapping with Smeserver-tw-logonscript

Offline lepounet

  • *
  • 17
  • +0/-0
No mapping with Smeserver-tw-logonscript
« on: July 04, 2016, 03:00:41 PM »
Hi all,

I have a problem with Smeserver-tw-logonscript.
SME is PDC
Logging works fine : I can see every windows login in /var/log/netlogon.log
User's home folder is well mapped even if I change the drive letter
But no other folder is mapped and the batch file is also not executed

That pb happened both with windows 7 and XP clients

Any idea where I could have a look to solve my pb.

Thanks in advance for any options or advice.

Offline lepounet

  • *
  • 17
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #1 on: July 12, 2016, 10:46:38 AM »
Hi all,

I have a problem with Smeserver-tw-logonscript.
SME is PDC
Logging works fine : I can see every windows login in /var/log/netlogon.log
User's home folder is well mapped even if I change the drive letter
But no other folder is mapped and the batch file is also not executed

That pb happened both with windows 7 and XP clients

Any idea where I could have a look to solve my pb.

Thanks in advance for any options or advice.

Hi all,

Am I the only one who have this problem ?
I used LoginScript manager successfully for years but it is no longer supported so I'm obliged with SME 9 to switch to Smeserver-tw-logonscript but it doesn't work.
I tried tu find an error in logs but don't see anything.

Thks again for your help

Alain

Offline ReetP

  • *
  • 3,950
  • +6/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #2 on: July 12, 2016, 02:33:32 PM »
I have no idea as I have no Windows machines, but I will ask Michael who wrote the contrib to view the thread.

Rgds
John
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline lepounet

  • *
  • 17
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #3 on: July 12, 2016, 06:18:41 PM »
thks a lot.

Alain

Offline mdo

  • *
  • 355
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #4 on: July 13, 2016, 10:57:37 AM »
Hi Alain

John made me aware of your posting, sorry had not seen it earlier.

One member of our team wrote the package and we are using if for every installation for all Windows clients (now up to Win10) without any problem. I am actually very proud of a piece of software that came from us which seems to be so robust and easy to implement.

Not sure where to start tracing this for you but let's try a few things.

Do you have a folder /home/e-smith/files/samba/netlogon/users/? Underneath you should have a generated file for each user ie. "michael.bat" (michael being the account/logon name)

My example here looks like this:

cat /home/e-smith/files/samba/netlogon/users/michael.bat

NET USE K: \\tga1\download
NET USE O: \\tga1\tw_tmp_tech
rem Custom group and user related scripts
CALL \\tga1\netlogon\custom\shared.bat
CALL \\tga1\netlogon\custom\tech.bat

Also, can you show the first few and especially the last lines from /home/e-smith/files/samba/netlogon/netlogon.bat , ie. here it is:

@echo off
rem --- Do not modify this file, if for any reason you need to run extra commands use the custom batch files groupname.bat under the custom folder or modify the custom-template under /etc/e-smith/templates-custom/home/e-smith/files/samba/netlogon/netlogon.bat ---
rem --- general logon script at TechnologyWise for Linux/Samba PDC functionality ---
set SERVER=tga1
set LOGONDRIVE=H
... cut ...
if exist X: net use X: /del /y
if exist Y: net use Y: /del /y
call \\%SERVER%\netlogon\users\%USERNAME%.bat
rem --- Vista does not map the home drive automatically ---
IF NOT EXIST %LOGONDRIVE% NET USE %LOGONDRIVE%: \\%SERVER%\%USERNAME%
if exist Z: net use Z: /del /y
rem --- eof netlogon.bat ---

...

Offline lepounet

  • *
  • 17
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #5 on: July 13, 2016, 11:49:16 AM »
Hi,

I'm sure the contribution of your team is great but doesn't work for me...

My files looks ok
I have one file for each user in  /home/e-smith/files/samba/netlogon/users/
Here's one of them :   user1.bat

NET USE Q: \\lupin\clip^M
NET USE Z: \\lupin\commun^M
NET USE R: \\lupin\gestion^M
NET USE T: \\lupin\tolerie^M
rem Custom group and user related scripts^M
CALL \\lupin\netlogon\custom\grp_test.bat^M

And here is my /home/e-smith/files/samba/netlogon/netlogon.bat  which looks good too :

@echo off
rem --- Do not modify this file, if for any reason you need to run extra commands use the custom batch files groupname.bat under the custom folder or modify the custom-template under /etc/e-smith/templates-custom/home/e-smith/files/samba/
netlogon/netlogon.bat ---
rem --- general logon script at TechnologyWise for Linux/Samba PDC functionality ---
set SERVER=lupin
set LOGONDRIVE=Y


net time \\%SERVER% /set /yes


rem --- general stuff i.e. drive mappings for all users ---
rem --- %username%.bat has been generated earlier
rem --- (see smb.conf, netlogon share, preexec statement)
rem --- to be able to assign drive mappings due to group membership
call \\%SERVER%\netlogon\users\%USERNAME%.bat
rem --- Vista does not map the home drive automatically ---
IF NOT EXIST %LOGONDRIVE% NET USE %LOGONDRIVE%: \\%SERVER%\%USERNAME%
if exist Z: net use Z: /del /y
rem --- eof netlogon.bat ---

But it still doesnt map any drive except home drive (Y in my case) which is well mapped

Any idea ?

Alain

Offline lepounet

  • *
  • 17
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #6 on: July 13, 2016, 11:59:10 AM »
By the way, I opened a dos window and typed :
call \\lupin\netlogon\users\user1.bat

Which is supposed  tu be executed when windows starts and it worked : all mapped drives appears and optional commands are well executed

So the batch file is well generated and works when launched manually but is not launched at start...

Thks for any suggestion

Offline mdo

  • *
  • 355
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #7 on: July 13, 2016, 12:05:56 PM »
Hi
I am no expert any longer in Windows client set ups and tracing Windows issues but things I suggest to try next:

From a command prompt on your Windows machine, run "net use" (to show you existing mappings)

then run the netlogon.bat manually like
\\lupin\netlogon\netlogon.bat

If this does not indicate any problem, I would add "pause" commands to the netlogon.bat file, especially before and after the line
call \\%SERVER%\netlogon\users\%USERNAME%.bat
...

Offline lepounet

  • *
  • 17
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #8 on: July 13, 2016, 12:25:21 PM »
it works too
drives are mapped, the problem is that \\lupin\netlogon\netlogon.bat seems not to be launched when windows starts

Offline mdo

  • *
  • 355
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #9 on: July 13, 2016, 01:08:53 PM »
Sorry, no more ideas for tonight, on my way to bed.

You are definitely using a MS Windows PRO os version (not a HOME version)?

Your /etc/samba/smb.conf includes:

logon script = netlogon.bat  ?
...

Offline lepounet

  • *
  • 17
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #10 on: July 13, 2016, 04:44:50 PM »
Yes of course win xp pro and win 7 pro
I tried to quit the domain for a workgroup and join the domain again but with no effect

Below is an extract from my /etc/samba/smb.conf :

log file = /var/log/samba/log.%m
logon drive = Y:

logon path =
logon script = netlogon.bat

map to guest = never



Should the logon path be empty ?

Offline mdo

  • *
  • 355
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #11 on: July 13, 2016, 07:37:22 PM »
The logon path will be needed if you want to use Roaming user profiles - which we always enable hence we have it set like below:

logon drive = H:
logon home = \\%L\%U\._winprofile
logon path = \\%L\Profiles\%U
logon script = netlogon.bat

Please show from smb.conf:

dns proxy = no

domain logons = yes
domain master = yes
dos charset = 850

and the output of:

db configuration show smb
...

Offline lepounet

  • *
  • 17
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #12 on: July 18, 2016, 10:56:12 AM »
Hi,

Sorry, I was out for Bastille day. A very sad Bastille day this year.


I don't use roaming profile so...

smb.conf extract :

dns proxy = no

domain logons = yes
domain master = yes
dos charset = 850

encrypt passwords = yes

It is same as yours


db configuration show smb output :

smb=service
    DeadTime=10080
    KeepVersions=disabled
    LogonDrive=Y
    LogonScript=/home/e-smith/files/samba/netlogon/logon_script
    OpLocks=enabled
    OsLevel=35
    RecycleBin=disabled
    RoamingProfiles=no
    ServerName=lupin
    ServerRole=PDC
    ShadowCount=10
    ShadowDir=/home/e-smith/files/.shadow
    UnixCharSet=UTF8
    UseClientDriver=yes
    Workgroup=My_Domain_Name
    status=enabled

thks for help

Alain

Offline mdo

  • *
  • 355
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #13 on: July 20, 2016, 08:16:00 AM »
Sorry, running out of ideas for the moment. As I said, we are suing it for each server installation and never had a problem. I might be too used to it to find the source of the problem.

Could you enable roaming user profiles for a moment to see whether that makes a difference?

Michael
...

Offline lepounet

  • *
  • 17
  • +0/-0
Re: No mapping with Smeserver-tw-logonscript
« Reply #14 on: July 20, 2016, 01:01:37 PM »
hi Michael

Unfortunately the roaming profile enabled dont change anything.
The only drive which map at start is the home drive.

There is perhaps a conflict with another contrib installed on my SME :

smeserver-wbl
smeserver-sogo
smeserver-shared-folders

I just uninstalled smeserver-shared-folders but no change...

Alain