Page 1 of 1 1
Topic Options
#47707 - 2003-11-11 10:41 AM Help with script in Netlogon folder
Mfarah Offline
Fresh Scripter

Registered: 2003-09-24
Posts: 27
Loc: London
Hi all

I would really appreciate some helpe here. I have a Kix script which I intend to use for mapping network drives based on group membership. Here is the script.

code:
  

;INI File
[DOMAIN\TestGroup01]
N=\\Server\testshare01
O=\\Server\testshare02

code:
  

For Each $group in Split(ReadProfileString('groups.ini','',''),Chr(10))
If $group AND InGroup($group)
For Each $drive In Split(ReadProfileString('groups.ini',$group,''),Chr(10))
If $drive
$resource=readprofilestring('groups.ini',$group,$drive)
$rc=execute('$$resource='+$resource)
Use $drive+':' /delete /persistent
Use $drive+':' $resource
;Use $drive+':' ReadProfileString('groups.ini',$group,$drive)
EndIf
Next
EndIf
Next

I have tested the script by running it locally and it works fine. I then placed the Kix files, script and INI file in my Netlogon share on the domain controller (This is an NT Domain). In the logon script path, I have tried all of the following,

kix32 \netlogon\script.kix

kix32.exe \netlogon\script.kix

kix32 script.kix

kix script.kix

None of these commands seem to work at all besides for;

kix32 \netlogon\script.kix

Which deletes the existing drive mappings but does not create the new ones.

Does anyone have any ideas ?

Top
#47708 - 2003-11-11 10:54 AM Re: Help with script in Netlogon folder
Mfarah Offline
Fresh Scripter

Registered: 2003-09-24
Posts: 27
Loc: London
I just realised that the deletion of the drive mappings my very well be a red herring. I might have manually deleted them yesterday.

I still have the same problem however.

[Mad]

[ 11. November 2003, 12:57: Message edited by: Mfarah ]

Top
#47709 - 2003-11-12 12:47 AM Re: Help with script in Netlogon folder
Mfarah Offline
Fresh Scripter

Registered: 2003-09-24
Posts: 27
Loc: London
Hi

Where is everybody ? Could someone please help !!

Top
#47710 - 2003-11-11 01:04 PM Re: Help with script in Netlogon folder
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Read the "Running KiXtart" section, which is on pages 11-13 of the 4.20 version of the manual.

This starts by explaining how to run KiXtart scripts locally, and then goes on to explain how to run them as logon scripts.

If you have Win9x clients be sure to read the warnings and the alternative method (batch file) of running login scripts.

If you still have problems, post an update.

Top
#47711 - 2003-11-11 01:21 PM Re: Help with script in Netlogon folder
Mfarah Offline
Fresh Scripter

Registered: 2003-09-24
Posts: 27
Loc: London
Hi Richard

Thanks for the reply. I have read through this section. I have tried inserting just; kix32.exe in the login script path and have renamed my script to kixtart.kix.

I have tried logging on from an XP and W2K Workstation and still have the same behaviour.

Any ideas ?

Top
#47712 - 2003-11-11 01:51 PM Re: Help with script in Netlogon folder
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Have you got any debug lines to ensure that the script is running?

How about adding some status information, so that you know that the INI file is being read?

I'd change the INI file path, as the reference will almost certainly fail.

This version will set the INI file path to the correct place, and display comments as it is doing the mapping:

; Set location of ini file, depending if we are logging on or testing.
If @LOGONMODE
$sGroupINI=@LSERVER+"\NetLogon\groups.ini"
Else
$sGroupINI=".\groups.ini"
EndIf
 
For Each $group in Split(ReadProfileString($sGroupINI,'',''),Chr(10))
If $group AND InGroup($group)
For Each $drive In Split(ReadProfileString($sGroupINI,$group,''),Chr(10))
If $drive
$resource=readprofilestring($sGroupINI,$group,$drive)
$rc=execute('$$resource='+$resource)
Use $drive+':' /delete /persistent
"Mapping drive "+$drive+": to "+$resource
Use $drive+':' $resource
If @ERROR
" ***ERROR***" ?
"["+@ERROR+"] "+@SERROR ?
Else
" OK" ?
EndIf
EndIf
Next
EndIf
Next


Top
#47713 - 2003-11-11 01:58 PM Re: Help with script in Netlogon folder
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
I don't think there is anything wrong with your KiXtart script. [Wink]

In your NTLOGON.BAT, you would typically do something like:

code:
kix32.exe %LOGONSERVER%\netlogon\KIXTART.kix

Here is a M$ Tech Artcle on this too.

A Logon Script Does Not Work If %0 or %0\..\ Calls Multiple Commands While this is geared for XP, there are some great insights for NT, 9x as well.

Kent

[ 11. November 2003, 13:59: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#47714 - 2003-11-11 03:17 PM Re: Help with script in Netlogon folder
Mfarah Offline
Fresh Scripter

Registered: 2003-09-24
Posts: 27
Loc: London
I left the script as is. Created a batch file NTLOGON.BAT In this file I set the path

code:
  

kix32.exe %LOGONSERVER%\netlogon\KIXTART.kix

And it works !! [Smile]

Thanks a million Kent.

Top
#47715 - 2003-11-11 03:20 PM Re: Help with script in Netlogon folder
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Just for good measure, I'd go with
code:
%LOGONSERVER%\netlogon\kix32.exe %LOGONSERVER%\netlogon\KIXTART.kix

to really force KiXtart to run from the logon server's NETLOGON share.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2082 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.033 seconds in which 0.015 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org