Koozali.org: home of the SME Server

netlogon.bat

Offline ansentry

  • ****
  • 118
  • +0/-0
netlogon.bat
« on: August 10, 2004, 01:05:16 PM »
I am using 6.0.1-01 0 custom

I am using the following logon script (below) , but am having problems with users who may may be a member of a group. When I was using 5.6 I could use ifg (If member of group) but it does not work with 6.0. When my script get to a mapped drive eg net use W: \\sme6\archive and the user is not a member of that group is asked  "Enter the user name for 'SME6':" , if I enter the user name it then asks for the password if you put that in it will close. If the user does nothing the script window sits on the taskbar. 2nd problem is that is does not happen every time the user logs in , every now and then  it will just run and close.

======================================================

REM----> THIS DISCONNECTS ALL DRIVES

if exist H: net use H: /delete /yes
if exist Z: net use Z: /delete /yes
if exist P: net use P: /delete /yes
if exist I: net use I: /delete /yes
if exist M: net use M: /delete /yes
if exist Y: net use Y: /delete /yes
if exist T: net use T: /delete /yes
if exist W: net use W: /delete /yes



REM -----> To set the time when users logon to the domain

net time \\SME6 /set /yes


REM -----> Connects to these Non Grouped drive

net use H: /home

net use P: \\SME6\public_sh

REM -----> Connects user to drives they are grouped to

net use I: \\SME6\install_sh

net use M: \\SME6\myob_sh

net use Y: \\SME6\access_be

==================================================

I have searched the site but cannot find anything regarding this problem.

I hope that someone out there is running netlogon.bat successfully

Any ideas would be appreciated.
Regards,

John A

Offline ansentry

  • ****
  • 118
  • +0/-0
netlogon.bat
« Reply #1 on: August 11, 2004, 10:32:35 AM »
Sorry to be a pain, but does anyone use a logon script that works with groups?

I have searched the net for hour’s to-day and found nothing.

I just ready need to have this working.

Sorry for being impatient

 :-(
Regards,

John A

mbachmann

netlogon.bat
« Reply #2 on: August 11, 2004, 10:48:00 AM »
i searched for netlogon.bat here as you did and got some 60 results. Maybe you should revise the results from here? Otherwise i don't have an idea. Sorry.

Offline ansentry

  • ****
  • 118
  • +0/-0
netlogon.bat
« Reply #3 on: August 11, 2004, 12:42:28 PM »
mbachmann,

Thank you for your reply, I have read all those but they do not address my problem.

My script runs fine, it works on win98, win2k and XP the problem is with members of groups. If a user have a tick to all my groups then they are connected without a problem to all their drives. The problem is the users who do not have permission to connect to selected ibays (not user of a group)

What I need is to be able to use something like "IF" but cannot find any help on the matter.

Thanks again.
Regards,

John A

ricrjhl

Re: netlogon.bat
« Reply #4 on: August 11, 2004, 02:46:42 PM »
Quote from: "ansentry"
What I need is to be able to use something like "IF" but cannot find any help on the matter.


Have a look at Kixtart, you can find it at http://www.kixtart.org. It's is a logon script processor for use with windows during logon. It should work in combination with Samba/SME.

ricrjhl.

Offline pkidd

  • *
  • 15
  • +0/-0
Re: netlogon.bat
« Reply #5 on: August 14, 2004, 05:30:52 PM »
Are your netlogon.bat's generated at logon by /usr/local/bin/generate_netlogon ?
...

Offline Brave Dave

  • *
  • 185
  • +0/-0
netlogon.bat
« Reply #6 on: August 15, 2004, 11:57:01 AM »
I'm tempted to bite on the generate_netlogon;

but search google for ;
ifmember site:microsoft.com

ifmember reports what groups a user is a member of works with w2k and xp, assume nt, don't think win9x though
.:DB:.

matsk

netlogon.bat
« Reply #7 on: August 15, 2004, 02:56:04 PM »
ifmember is a part of the "Windows Resource kit" that you have to buy!

But I would recomment Kixtart !


/Mats

Offline ansentry

  • ****
  • 118
  • +0/-0
Re Netlogon.bat
« Reply #8 on: August 15, 2004, 05:29:18 PM »
Sorry have been missing for a couple of day, and have just read the replies.15th +

pkidd:
The login script (above) I have in /home/e-smith/files/samba/netlogin. If I go to /usr/local/bin there is no generate_netlogon, what is this? Thank you for your reply.

davidbray:
Thanks for your reply.

Matsk:
Thank you for your reply, I downloaded kixtart am just starting to read the help doc.With kixtart how do I associate my netlogon.bat to the kixtart.exe?

Any help would be appreciated, I am surprised how little there is about this problem (groups in nelogon) on this site.

 :-)
Regards,

John A

matsk

netlogon.bat
« Reply #9 on: August 15, 2004, 07:36:28 PM »
To install KiXtart on the network, copy kix32.exe and wkix32.exe files to the NETLOGON share of the logonserver(s).

Create netlogon.bat with the content:
Code: [Select]
START /w WKIX32.EXE logon.kix
or
Code: [Select]
KIX32.EXE logon.kix
and copy it to your NETLOGON share.

/d sets the kix into debug mode


Then you create the logon.kix and copy it to the NETLOGON share, it's a plain text file.

The command/function we are going to use is :
use and InGroup and SetTime


Example :
Code: [Select]

;****************
; Sync the time
;*****************
SetTime "\\SME6"

;****************
; Delete any old drive shares
;*****************
use * /delete

;****************
; Connect common shares
;*****************
use H: /home
use P: \\SME6\public_sh

;****************
; If in group then
;*****************
if ingroup(administrators)
    use O: \\SME6\Admin_sh
endif

if ingroup(install)
    use I: \\SME6\install_sh
endif



And read the http://www.kixtart.org/bin/KIX2001.doc

Is this what you where looking for?

This is for WinNT/2K/XP for Win9X you have to install some dll's but that is covered in the manual (Word version, the chm file is a reference guid !).


/Mats

Offline Brave Dave

  • *
  • 185
  • +0/-0
netlogon.bat
« Reply #10 on: August 15, 2004, 08:13:23 PM »
Quote from: "matsk"
ifmember is a part of the "Windows Resource kit" that you have to buy!

/Mats



Some parts of the resource kit are available for free download;

http://www.microsoft.com/windows2000/techinfo/reskit/tools/new/ifmember-o.asp
.:DB:.

Offline ansentry

  • ****
  • 118
  • +0/-0
re netlogin.bat
« Reply #11 on: August 16, 2004, 06:53:09 AM »
Matsk

I  copied  both KIX32.exe and WKix32.exe  to /home/e-smth/files/samba/netlogin.

Then made my netlogon.bat read  START  /w  WKIX32.EXE login.kix

I then created a text file and called it login.kix (with comments)

Below is what I put in my login.kix

SetTime "\\SME6" ;Works


USE  * / DELETE ;Does not Work

 USE T:  /DEL  ;Does not Work

USE P: \\SME6\PUBLIC_SH ; Works

USE Z: /DEL ;Works

USE H: @HOMESHR ;Works

IF INGROUP(archivegp);Does not Work

USE T: \\SME6\archive

ENDIF

I made no changes to the client (users Win XP Pro PC)

I changed use H: /home to USE H: @HOMESHR and it is working fine. I had to use Z: /DEL as XP connects Z as the home directory. I know that you can change this but this is easier if you have lot of client pc's

If you can see what I am doing wrong, please advise. I am now going to have a look at the kioxtart forum.


davidbray

I have downloaded the file you suggested and will hold in in reserve in case I can’t get kixtart to work for me.


Thank you both
 :-)  :-)
Regards,

John A

Offline ansentry

  • ****
  • 118
  • +0/-0
netlogon.bat
« Reply #12 on: August 16, 2004, 02:25:01 PM »
matsk,

Since my last post, I have tried different scripts, but a very funny thing has happened. I have 2 PC's here at home 1 running XP Pro and the other win2K, both login to the SME Server. I have 4 different users so that I can test the logins etc. I install the following script and called it login.kix (you will see some of your script in there), as you can see it has NO IFGROUP, but it works. First user "johna" should be able to connect to all 7 and it does. "test" should connect to H & P and 3 others and it does. "homepc2" should connect to H & P and 3 others (different to test) and it does. etc etc. I have tested each login three time on each machine and not 1 mistake. If I connect as john I get the 7 mapped, log off and log on as test and I get five the other 2 have disconnected. I have no idea why it is working. One thing on the XP machine 2 of the users are roaming  profile and 1 local.



Now I will have to try and work out why this is happening. below copy of login.kix

;****************
; Sync the time
;*****************
SetTime "\\SME6"

;****************
; Delete any old drive shares
;*****************
use * /delete

;****************
; Connect common shares
;*****************
USE Z: /DEL ;this is windows default for home
USE H: @HOMESHR ;connects to sme6 home directory
USE P: \\SME6\PUBLIC_SH
USE I: \\SME6\INSTALL_SH
USE M: \\SME6\MYOB_SH
USE W: \\SME6\EMPLOYKITS
USE T: \\SME6\TEMPLATES_SH
USE y: \\SME6\ACCESS_BE

Thank you again for your help and interest, any suggestion would be appreciated.

 :-)
Regards,

John A