#47707 - 2003-11-11 10:41 AM
Help with script in Netlogon folder
|
Mfarah
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
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]](images/icons/mad.gif) [ 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
Fresh Scripter
Registered: 2003-09-24
Posts: 27
Loc: London
|
Hi
Where is everybody ? Could someone please help !!
|
|
Top
|
|
|
|
#47711 - 2003-11-11 01:21 PM
Re: Help with script in Netlogon folder
|
Mfarah
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
   
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
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I don't think there is anything wrong with your KiXtart script.
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 ]
|
|
Top
|
|
|
|
#47714 - 2003-11-11 03:17 PM
Re: Help with script in Netlogon folder
|
Mfarah
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 !!
Thanks a million Kent.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1821 anonymous users online.
|
|
|