2hotty
(Getting the hang of it)
2002-04-11 12:10 AM
just started

I recently just started investigating logon scripts. I created a simply logon script that would map a test users' profile to a printer when they logged onto the network. My primary domain server is running NT4 and i placed the script file in the location - Winnt\System32\Repl\Import\Scripts and in the user's profile i typed in the name of the script where it says ' Script name'. I cant understand why it doesn't work. Here is a copy of the script i designed. Cane anyone help me please as i am new to the game.

cls
color g/n
"Hello, " + @USERID
?

;=== Setting Variable ===

$NTLocalServer=""
$Printer1=""
$Printer2=""
$Printer3=""
$Printer4=""
$Printer5=""
$DefaultPrinter=""

;=== Set Variable ===
SELECT
case InGroup ("smithb")
$NTLocalServer = "\\ESSBASE_1"
$Printer1 = "\\HRTC\claser1"
$Printer2 = "\\HRTC\claser2"
$DefaultPrinter = "\\HRTC\claser1"


LonkeroAdministrator
(KiX Master Guru)
2002-04-11 12:30 AM
Re: just started

this script you have here does not seem to do almost anything but...

let's cut from the beginning.
does the script start at all?
if not, try connecting to servers netlogon share.
\\server_name\netlogon

if you see there the script, try running it by hand.
does it work that way?
then, if you put to user manager the script name you must include also kix32 in it.
and this is not allowed on win9x-clients.

here is something to bite.
tell us something more of your trials and we are doing what we can to help you out.

cheers,


2hotty
(Getting the hang of it)
2002-04-10 01:16 PM
Re: just started

till doesn't work. Do i have to have the kix files located somewhere on the user's machine and what format should i save the script file as

LonkeroAdministrator
(KiX Master Guru)
2002-04-10 01:31 PM
Re: just started

the format should be plain text. neither does the place where kix-files are located.
you will need to find a way to run it by hand.
if you can't run it manually it will not work as logon script either.
if the script file is found from \\logonserver\netlogon-share you might also put the kix32.exe there
then try it manually as run statement:
\\logonserver\netlogon\kix32 yourscript.kix

if it will not work this way neither does your server nor wksta nor anything.

simple as that.

if it works this way, add line to the users logonscript field:
kix32 yourscript.kix

and it works the same way.

add a line to the end of your script:
? "finished" get $nul

this stops the script until a key is pressed and you wont miss the execution.

ok?


2hotty
(Getting the hang of it)
2002-04-10 02:16 PM
Re: just started

still stuck can anyone help please

LonkeroAdministrator
(KiX Master Guru)
2002-04-10 02:20 PM
Re: just started

scott, it would help us help if you would say where you're stuck.
how else we can now are you stuck in traffic yam or is your problem computer related.


2hotty
(Getting the hang of it)
2002-04-10 02:38 PM
Re: just started

When i try and logon using the user profile on a windows 2000 machine nothing happens. I have typed in the location for the script file as kix32 test.scr(name of the script). The primary server is NT4. The server where the printer are located is win 2000. Kix32 is located in the right directory on the primary server. Nothing i don't understand why. You guys seem to know this stuff really well, what am i doing wrong. The help is really appreciated.

2hotty
(Getting the hang of it)
2002-04-10 03:14 PM
Re: just started

Can someone please help i am really confused

Sealeopard
(KiX Master)
2002-04-10 03:33 PM
Re: just started

Okay, let's go back to square one [Razz]

First of all, please do this step-by-step, double-checking everything to make sure it works. There is no point in going to step 2) if step 1) doesn't work.

Step 0:
Download Kixtart 4.02

Step 1:
If you only have a PDC then you will put your script into %SYSTEMDRIVE%\Winnt\System32\Repl\Import\Scripts which is normally mapped as \\PDC\NETLOGON (replace PDC with the name of your PDC)

If you have a PDC and one or more BDC then you will have to put your scripts into %SYSTEMDRIVE%\Winnt\System32\Repl\Export\Scripts and enable replication on the PDC. This will copy the scripts automatically to the 'import' directories of the PDC and all BDCs as soon as the file is changing in %SYSTEMDRIVE%\Winnt\System32\Repl\Export\Scripts.

If you have Windows 9x computers that are logging into the domain, install the Kixtart RPC server on all domain controllers as per manual or use the XNET example script in the Kixtart download to install the RPC server.

DO NOT USE KIXTART 4.10b1 BECAUSE IT IS BETA AND NOT TO BE USED IN A PRODUCTION ENVIRONMENT!!!

Check out http://81.17.37.55/board/ultimatebb.php?ubb=get_topic;f=10;t=000024

Step 2:
Create a simple login batch file like LOGIN.BAT:
code:
ECHO Running login script

PAUSE

Put it into the appropriate directory based on step 1) and check it is getting replicated.
Assing the script LOGIN.BAT as the login script to a test user in the 'User Manager for Domains'

Step 3:
Log in with the test user from a workstation and make sure that the login script runs.

Step 4:
Modify the login script LOGIN.BAT to
code:
ECHO Running Kixtart login script

%0\..\KIX32.EXE %0\..\LOGIN.KIX

PAUSE

Copy KIX32.EXE, KX*.DLL into the appropriate directory based on step 1) and check it is getting replicated.
Create a text file called LOGIN.KIX containing the lines
code:
? 'Kixtart Login Script'
? 'Username : ' + @USERID
? 'Computer : ' + @WKSTA

Step 5:
Log in with the test user from a workstation and make sure that the login script runs.

Step 6:
Success, have a beer, report back to the BBs that it's working

Step 7:
Get fancy, modify the script for drive and printer mappings

Step 8:
Browse the BBS for more advanced login script features

Step 9:
Get Kixtart to brew a cup of coffee for you [Wink]

[ 10 April 2002, 18:31: Message edited by: sealeopard ]


2hotty
(Getting the hang of it)
2002-04-10 04:04 PM
Re: just started

you have been the most help, but i only got to step 3. I placed the script and bat file on the pdc in the right folder but it did not replicate and therefore the script did not run when i logged on. I think my server automtaically replicates but how can i make sure?

BrianTX
(Korg Regular)
2002-04-10 04:09 PM
Re: just started

It can take about 15 minutes to replicate in most cases. Make sure the replicator is enabled under services. If it is, check the event log for errors. If everything seems to be working properly, then check \\lserver\netlogon to see if the files are available. If still no luck, try stopping and restarting replicator services on your DCs.

Brian


2hotty
(Getting the hang of it)
2002-04-10 05:02 PM
Re: just started

thanks guys i am actually getting somewhere. After creating the text file - login.kix, i place it in the pdc and it was replicated, but when i logon i get - login.kix is not recognised as an internal or external command, operable program or bacth file.

Sealeopard
(KiX Master)
2002-04-10 05:27 PM
Re: just started

Did you do step 4) ?
Did the LOGIN.BAT run and display the appropriate text?


2hotty
(Getting the hang of it)
2002-04-10 05:37 PM
Re: just started

yeh, but it said that it couldn't recognise login.kix

Sealeopard
(KiX Master)
2002-04-10 06:09 PM
Re: just started

Okay, so LOGIN.BAT, LOGIN.KIX, and KIX32.EXE are all in the same directory \\PDC\NETLOGON ?

What happens if you double-click on LOGIN.BAT in \\PDC\NETLOGON from a workstation in order to execute the login script manually? It should run.

BTW, LOGIN.KIX is just a text file not an executable that's why you can't run it by itself. It must be run through KIX32.EXE.


Chris S.
(MM club member)
2002-04-10 06:18 PM
Re: just started

Jens, there was a syntax error in your Logon.bat snipet. The correct change to logon.bat should read:

code:
ECHO Running Kixtart login script
%0\..\KIX32.EXE %0\..\LOGIN.KIX
PAUSE



[ 10 April 2002, 18:20: Message edited by: Chris S. ]


Sealeopard
(KiX Master)
2002-04-10 06:32 PM
Re: just started

Thanks, corrected.

bowhuntr
(Fresh Scripter)
2002-04-10 07:15 PM
Re: just started

I know this seems basic, but did you go back before starting Sealeopard's plan and change the profile logon script name to login.bat for the test user?

2hotty
(Getting the hang of it)
2002-04-11 10:02 AM
Re: just started

I changed the login.bat to

ECHO Running Kixtart login script
%0\..\KIX32.EXE %0\..\LOGIN.KIX
PAUSE

Then i manually started it but now it is saying - ' script error. Failed trying to find/open scipt.

Any ideas guys?


2hotty
(Getting the hang of it)
2002-04-11 10:31 AM
Re: just started

sorry guys, it does work. u are all brill and i am very grateful for all your help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

LonkeroAdministrator
(KiX Master Guru)
2002-04-11 11:14 AM
Re: just started

just informational:
logon batch file is not needed on win2k or nt.
it's needed only for win9x.
if someone has pure net which has no win9x machines nor win 3.11 he can just say in user manager:
kix32 login.kix

cheers,


bowhuntr
(Fresh Scripter)
2002-04-11 04:20 PM
Re: just started

Lonkero,

Does such a network really exist?!?!? [Big Grin]


LonkeroAdministrator
(KiX Master Guru)
2002-04-11 04:24 PM
Re: just started

BowHuntR,
I'm heading to that.
not so many bastards in my net anymore.
and when computers need to be renewed it will be automaticall.
in my current working network, there is only 5-10 win9x machines left!

and I'll not rest until I get wkix32 login.kix to usermanager!

cheers,