Pech
(Getting the hang of it)
2002-10-21 07:02 AM
I got error when I run kix script at first time.

Help me.. pls
I got error when I start to run Kix script..

Error is.. Can't sync clock with PDC..

I don't know why.. My Server is Windows 2000 Server and Client is Windows 2000 Pro.

PLogon.bat is store in User Profile..
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ECHO off
IF "%OS%" == "Windows_NT" goto NT_OS
CALL \\bstl_svr1\netlogon\kix32 PLogon9x.kix
EXIT
:NT_OS
call \\bstl_svr1\netlogon\kix32 \\bstl_svr1\netlogon\PLogonNT.kix
EXIT
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

PLogon9x.kix (for windows 9x)
**********************************************
? "Setting Win9x variables...please, wait."
; SHELL "winset.exe USERNAME=''"
SHELL "winset.exe USERNAME=@USERID"
; SHELL "Winset.exe ADDRESS=@ADDRESS"
; SHELL "Winset.exe COMPUTER=@WKSTA"
; SHELL "Winset.exe DOMAIN=@DOMAIN"
; SHELL "Winset.exe COMMENT=@COMMENT"
; SHELL "Winset.exe FULLNAME=@FULLNAME"
; SHELL "Winset.exe HOMEDIR=@HOMEDIR"
; SHELL "Winset.exe HOMESHR=@HOMESHR"
; SHELL "Winset.exe LSERVER=@LSERVER"
; SHELL "Winset.exe PRIV=@PRIV"
? "Done."

? "Map Network drive (User)..."
SHELL "net use * \\bstl_svr3\@USERID$ /no"

IF Ingroup ("MK11") = 1
shell "net use * \\bstl_svr3\DocMK11$ /no"
shell "net use * \\bstl_svr3\ShareDoc /no"
shell "\\bstl_svr1\ofcscan\autopcc.exe"
ENDIF
exit
**********************************************

PLogonNT.kix (for Windows NT,xp, 2000)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
shell "net use * \\bstl_svr3\%username%$ /Persistent:no"

IF Ingroup ("MK11") = 1
shell "net use * \\bstl_svr3\DocMK11$ /Persistent:no"
shell "\\bstl_svr1\ofcscan\autopcc.exe"
ENDIF
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

I got error when user logon to domain and run scrip PLogon.bat at first time.. Error is Server can't sync clock with PDC...

If I wait a few minute.. and run Plogon.bat again, It works.. What happend?

My Server service: Kxrpc is started, Windows Time is started.

Help me please...
Pech


Kdyer
(KiX Supporter)
2002-10-21 07:12 AM
Re: I got error when I run kix script at first time.

Pech,

What version of KiXtart are you running?

Where are you setting time in this code?

If you have upgraded your clients to version 4.x, did you get all DLLs, EXEs, etc.?

Why are you using (for example) -
code:
SHELL "net use * \\bstl_svr3\@USERID$ /no"

??

Why not use instead -
code:
USE F: "\\bstl_svr3\@USERID$"

Thanks,

Kent


LonkeroAdministrator
(KiX Master Guru)
2002-10-21 07:41 AM
Re: I got error when I run kix script at first time.

pech, you should use the same topic and not start a new one and ask same question again once a week.

http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=005992

 


Pech
(Getting the hang of it)
2002-10-21 10:45 AM
Re: I got error when I run kix script at first time.

I have not a problem with my script. (shell "net use * \\bstl_svr3\%username%$ /Persistent:no") <-- no problem.

But I have a problem when I start run script at first time. If I wait a few minutes and run script again, It works.

My error is : Server can't sync clock with PDC.

Kixtart : 4.11

Please tell me more
Pech
Prevoiusly I never got any problem. After


Sealeopard
(KiX Master)
2002-10-21 03:07 PM
Re: I got error when I run kix script at first time.

Pech: The 'no problem' is not an issue. An issue is that you should rather use the KiXtart-native USE statement than SHELLing out again. What's the point of using KiXtart if you do everything with non-KiXtart commands anyway.

You should also not hard-code the call to your login server, it is not considered 'best practice'.

Why do you manually sync the time if there's the build-in Time Server service? The recommended setup for Windows 2000/XP is to synchronize the time automatically through the time server. There is ABSOLUTELY NO NEED for ordinary users to manually sync time or even sync time through the login script because you will have to adjust security permissions to actually give ordinary users the right to change the system time.

Why do you want to make it more complicated if there's an easy solution?


Pech
(Getting the hang of it)
2002-10-22 06:01 AM
Re: I got error when I run kix script at first time.

To.Jens

How I can config The Windows Time Server..
It's problem with Client are Windows XP, NT, 2000.

I don't why? If I wait a few minutes and run PLogon.bat again It's work.. But at first login failed..

Pech


Kdyer
(KiX Supporter)
2002-10-22 06:52 AM
Re: I got error when I run kix script at first time.

Pech,

It looks like you have two things going on here..

Maybe a couple of Microsoft "Q" Articles to get you started:

Login Script -
A Logon Script Does Not Work If %0 or %0\..\ Calls Multiple Commands

Time Server Setup/Info -
How to Configure an Authoritative  Time Server in Windows 2000 (Q216734)

How Machines Determine the  Time Source  Server Using NET  TIME (Q156460)

"Could Not Locate a  Time Server" After Setting SNTP  Time Server Using NET  TIME Command (Q243574)

HTH,

Kent


Pech
(Getting the hang of it)
2002-10-29 10:10 AM
Re: I got error when I run kix script at first time.

Kent,
I visit the link (microsoft), but I try to do with my server (windows 2000), but cann't solved my problem,
First login failed.. with Error 2457 "Server clock cannot sync with PDC).
After that I've to wait a few minutes and run script by manual, It works!!! I don't khow why not?

Help
PEch


LonkeroAdministrator
(KiX Master Guru)
2002-10-29 10:18 AM
Re: I got error when I run kix script at first time.

eh, login failed?
if your login failes it can't actually be nothing related to time service.

anyway, does your w2k PDC have time service configured?

if you do not have w2k PDC it will not work with defaults.


Pech
(Getting the hang of it)
2002-10-29 11:09 AM
Re: I got error when I run kix script at first time.

I didn't config the time service. Time Service is started.. I never get right to any person to sync clock.

How I can disable automatic sync clock with Server.

When I use Shell command ,,, an error has occured..
If I use command : use * \\domain\share
This command doesn't do anything.

Pech


Sealeopard
(KiX Master)
2002-10-29 03:27 PM
Re: I got error when I run kix script at first time.

Pech:

Please take a look a the required syntax for USe in the KiXtart Manual. your USE command has to look like this:
code:
use * '\\server\share'

Also, the Time Service is AFAIK required in an AD domain in order to successfully authenticate Kerberos passwords. The link provided to you do explain how to correctly set up the time service please do so.

Regular users do not require the right to change the system time, changing the system time would indicate malicious intent.

[ 01. November 2002, 14:46: Message edited by: sealeopard ]


Pech
(Getting the hang of it)
2002-10-30 08:04 AM
Re: I got error when I run kix script at first time.

Now I can solved the windows time problem, because I used command shell.. I think it's not support with Kix.

But I have a new problem.
First logon it has not no error, but logon script
use f: "\\domain\share" It's not do anything.

If I wait a few minutes and run that's script by manual, It work!.

Please advice me.
Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 12:14 AM
Re: I got error when I run kix script at first time.

command shell?

we have no clue what you are talking about as you don't let us to see your current script.
this use line we have seen multiple times already and I say, I believe it has nothing to do with the actual problem.

first hit would be to know do you still have the bat calling kix as it can't run that way.
use these lines for nt/w2k/xp:
:NT_OS
kix32 PLogonNT.kix
EXIT


Pech
(Getting the hang of it)
2002-10-31 03:01 AM
Re: I got error when I run kix script at first time.

Logon.bat
*************************************************
ECHO ON
set path=c:\winnt\system32;\\bstl_svr1\netlogon;
IF "%OS%" == "Windows_NT" goto NT_OS
CALL \\bstl_svr1\netlogon\kix32.exe Logon9x.bat
EXIT

:NT_OS
call \\bstl_svr1\netlogon\kix32.exe \\bstl_svr1\netlogon\LogonNT.kix
EXIT
*************************************************

Logon9x.bat
-------------------------------------------------
? "Setting Win9x variables...please, wait."
SHELL "winset.exe USERNAME=@USERID"
? "Done."
? "Map Network drive (User)..."
SHELL "net use * \\bstl_svr3\@USERID$ /no"

IF Ingroup ("MK11") = 1
shell "net use * \\bstl_svr3\DocMK11$ /no"
shell "net use * \\bstl_svr3\ShareDoc /no"
shell "\\bstl_svr1\ofcscan\autopcc.exe"
ENDIF
------------------------------------------------

LogonNT.kix
------------------------------------------------
use "*" /delete

use h: "\\bstl_svr3\%username%$"

IF Ingroup ("MK11") = 1
use i: "\\bstl_svr3\DocMK11$"
run "\\bstl_svr1\ofcscan\autopcc.exe"
ENDIF
-----------------------------------------------

It has problem with LogonNT.kix only (Windows NT,2000,xp)
When user start to login. (LogonNT.kix)command map drive (use) does not do anything, but run command done only.If user with a few minutes and run Script (Longon.bat-> LogonNT.kix) by manual it work.

Why not?

Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 03:05 AM
Re: I got error when I run kix script at first time.

I don't know about how it actually works but call is made for calling batch files.
so, first start by correcting your logon.bat:
Logon.bat
*************************************************
ECHO ON
set path=c:\winnt\system32;\\bstl_svr1\netlogon;
IF "%OS%" == "Windows_NT" goto NT_OS
z:\kix32.exe Logon9x.bat
EXIT

:NT_OS
kix32.exe LogonNT.kix
EXIT
*************************************************


Pech
(Getting the hang of it)
2002-10-31 03:21 AM
Re: I got error when I run kix script at first time.

No problem with Logon.bat --> call Logon9x.bat

But I have only problem with LogonNT.kix
Command USE does not do anything..
Command RUN done.

This problem has a first logon only. If I wait a few minutes and run script (Logon.bat) by manual It work!

Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 03:24 AM
Re: I got error when I run kix script at first time.

well, you say that it's failing first logon only.
nope, when you say that it runs manually after waiting five minutes, you say that it does not work at all in netlogon.


Pech
(Getting the hang of it)
2002-10-31 03:28 AM
Re: I got error when I run kix script at first time.

If run script by manual in NETLOGON. It works.
But I have to wait a few min.

Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 03:29 AM
Re: I got error when I run kix script at first time.

also, does both use lines fail or only other one?

then you could try with this version and post it's givings:
code:
"nt logonscript"
? @kix
? @dos
? @ldrive

use "*" /delete
? "delete persistent mappings: " @serror

use h: "\\bstl_svr3\%username%$"
? "mapping h: to homeshare: " @serror

IF Ingroup ("MK11") = 1
use i: "\\bstl_svr3\DocMK11$"
? "mapping i: to groupshare: " @serror
shell "\\bstl_svr1\ofcscan\autopcc.exe"
ENDIF
? "logonscript ran"
?? "press any key to close window"
get $

waiting for reply. and please change at least that nt part of your logon.bat

[ 31. October 2002, 03:30: Message edited by: Lonkero ]


Pech
(Getting the hang of it)
2002-10-31 03:42 AM
Re: I got error when I run kix script at first time.

No meaning...
Same like me. Cann't solved the problem, If I wait a few min it works.

Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 03:44 AM
Re: I got error when I run kix script at first time.

pech, what means no meaning.
could you be so kind that you give the output of the script window to us, please.


Pech
(Getting the hang of it)
2002-10-31 03:54 AM
Re: I got error when I run kix script at first time.

I meant the result same as my script (LogonNT.kix)

I cann't give the screen to you, coz .. no action to do anything with USE command.. (first logon)

Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 03:57 AM
Re: I got error when I run kix script at first time.

pech, I don't quite follow...

I know that you have said about ten times that it does not work.
what I don't know where the error is.
instead of repeating that it does not work you could say what error kix gives you.

now, I thought that if I set up a script for you with error codes and all, you could give back the errors.
eh, maybe I just asked too much.


Pech
(Getting the hang of it)
2002-10-31 04:04 AM
Re: I got error when I run kix script at first time.

I meant my LogonNT.kix USE command cann't map drive.

When I login to network at first time.
Logon.bat and Than call to LogonNT.kix.

USE "*" /delete --> Disconnect from all map drive : Work
USE H: "\\bstl_svr3\%username%$" --> Map drive, but It can't map drive with No any error.
Shell "\\bstl_svr3\ofscan\autopcc.exe" --> Antivirus update pattern : Worked and No any error.

After finished the run script. I open in my computer, no network drive mapping.

And The I wait a few minute and run script by manual. (\\bstl_svr1\netlogon\logon.bat) Map drive is working.

Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 04:09 AM
Re: I got error when I run kix script at first time.

so, what is the difference with "work" and "no any error"

I understand it as they are all the same and the logonscript returns you:
quote:

nt logonscript
4.10
5.0
\\server\netlogon
delete persistent mappings: Command completed succesfully
mapping h: to homeshare: Command completed succesfully
mapping i: to groupshare: Command completed succesfully
logonscript ran

press any key to close window


is this the case?


Pech
(Getting the hang of it)
2002-10-31 04:22 AM
Re: I got error when I run kix script at first time.

delete persistent mappings: Command completed succesfully
mapping h: to homeshare: Command completed but NOT succesfully: Cann't Map drive and no any error
mapping i: to groupshare: Command completed NOT succesfully: Cann't Map drive and no any error
logonscript ran

press any key to close window


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 04:27 AM
Re: I got error when I run kix script at first time.

eh, there is no error if it says command completed successfully and I quess that is the case even though you again didn't show it.
dunno, you have a habit of repeating [Wink]

I know that it does not work.
so, did you do it with your own script or with copy&pasted one from my previous post?

the last thing I'm after with this is that if you used my script, I changed the run to shell.

in some cases that has affect too.

ok, do you have changed the logon.bat already on the part of calling the kix in nt-section?


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 04:30 AM
Re: I got error when I run kix script at first time.

also, I asked for the @dos, @kix and @ldrive results in the script but seems that your kix is broken as it denies the pleasure of showing those...

Pech
(Getting the hang of it)
2002-10-31 04:48 AM
Re: I got error when I run kix script at first time.

Result:
----------------------------------------
4.11
5.0
\\bstl_svr1\netlogon\
delete persisten mapping : The operation completed succusesfull
mapping h: to home share : An extended error has occurred.
longonscript ran
press any key to close windows.
----------------------------------------

That's it!

Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 04:51 AM
Re: I got error when I run kix script at first time.

thank you!

now we know the error!
and that it never goes to the ingroup.
that means also that the run or shell does not run either.

could you change the @serror to @error to see the errorcode number and I'll start searching for the explanation.

and, you didn't answer on that logon.bat part.
did you change the ntlogon.kix line?


Pech
(Getting the hang of it)
2002-10-31 05:07 AM
Re: I got error when I run kix script at first time.

Result:
----------------------------------------
4.11
5.0
\\bstl_svr1\netlogon\
delete persisten mapping : 0
mapping h: to home share : 1208
mapping h: to group share : 1208
longonscript ran
press any key to close windows.
----------------------------------------

That's it!

Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 05:08 AM
Re: I got error when I run kix script at first time.

changed that logon.bat?

Pech
(Getting the hang of it)
2002-10-31 05:14 AM
Re: I got error when I run kix script at first time.

ECHO ON

IF "%OS%" == "Windows_NT" goto NT_OS
CALL \\bstl_svr1\netlogon\kix32.exe PLogon9x.kix
EXIT

:NT_OS
CALL \\bstl_svr1\netlogon\kix32.exe \\bstl_svr1\netlogon\PLogonNT.kix
EXIT

How to change?

Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 05:19 AM
Re: I got error when I run kix script at first time.

like I wrote it about 12 replies before [Big Grin]

if you open commandline and type "call /?" you see that it may not be used for calling an exe.

so, make your logon.bat as:

ECHO ON

IF "%OS%" == "Windows_NT" goto NT_OS
z:\kix32.exe z:\PLogon9x.kix
EXIT

:NT_OS
kix32.exe PLogonNT.kix
EXIT


tell also does that remove the error, or do I start looking for explanation.
that error is so spooky that I want "us" to try normalizing before the search...

[ 31. October 2002, 05:21: Message edited by: Lonkero ]


Pech
(Getting the hang of it)
2002-10-31 05:35 AM
Re: I got error when I run kix script at first time.

If I dint specify path of netlogon

\\bstl_svr1\netlogon\

kix32.exe--> Bad command cann't find this command or paht of command

-----------------------------------------------
ECHO ON

IF "%OS%" == "Windows_NT" goto NT_OS
\\bstl_svr1\netlogon\kix32.exe \\bstl_svr1\netlogon\PLogon9x.kix
EXIT

:NT_OS
\\bstl_svr1\netlogon\kix32.exe \\bstl_svr1\netlogon\PLogonNT.kix
EXIT
-----------------------------------------------

Error code in LogonNT.kix
in Map drive is : 1208


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 05:37 AM
Re: I got error when I run kix script at first time.

can't find command?
how are you running the batch?
if you have nt-domain, what is specified as logonscript in usermanager?


Pech
(Getting the hang of it)
2002-10-31 05:51 AM
Re: I got error when I run kix script at first time.

Your script
ECHO ON
IF "%OS%" == "Windows_NT" goto NT_OS
z:\kix32.exe z:\PLogon9x.kix
EXIT

:NT_OS
kix32.exe PLogonNT.kix
EXIT
Has error because, not spectify path

I keep kix32.exe in \\bstl_svr1\netlogon, I must specify path for kix32

My Script
ECHO ON
IF "%OS%" == "Windows_NT" goto NT_OS
\\bstl_svr1\netlogon\kix32.exe \\bstl_svr1\netlogon\PLogon9x.kix
EXIT

:NT_OS
\\bstl_svr1\netlogon\kix32.exe \\bstl_svr1\netlogon\PLogonNT.kix
EXIT
**

I put PLogon.bat in Profile (User property)
Also It has no error with PLogon.bat.
An Error has occurred with PLogonNT.kix

Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 05:56 AM
Re: I got error when I run kix script at first time.

for nt/w2k/xp there is no need to specify path during logon if the script and kix32 is in netlogon.
for win9x the z: drive is mapped automatically to netlogon during logon.

but, if you get error with that, it means that you don't have the kix32 in the netlogon server.
you may also have problems in your network elsewhere.

I had 3 weeks ago broken DNS setup and caused half of the wksta's to fail to run the script.

with windows NT/2000/xp you can put in your usermanager:
kix32 logon.kix

and it works too.
if not there is error somewhere.

so, now I must ask, does all your logonservers have the script and kix32 in their netlogon or just that one?


Pech
(Getting the hang of it)
2002-10-31 06:08 AM
Re: I got error when I run kix script at first time.

Impossible I keep kix32.exe in \\bstl_svr1\netlogon (Only one DC)

When I browser the network,I can see all the file in this file sharing (\\bstl_svr1\netlogon).

If I'm specify path I can't run it.

In our network, my client has many client such as 98,NT,2000 and XP.

How I can specify the script in User Profile.
Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 06:14 AM
Re: I got error when I run kix script at first time.

like you said you did for the bat.

anyway, you should not run netlogon service on any server not having the script.
all dc's should indeed have those scripts in netlogon drive.

to specify the script directly in profile just write:
kix32 scriptname.kix

in there.
it does not work for win9x but testing purposes it handles.
and all users in my lan have that as I've got rid of the decease of win9x.


Pech
(Getting the hang of it)
2002-10-31 10:57 AM
Re: I got error when I run kix script at first time.

I just put kix32.exe PLogonNT.kix in User Profile
But When I start to logon.. No any action..

How I can handle this error!

Pech


LonkeroAdministrator
(KiX Master Guru)
2002-10-31 01:19 PM
Re: I got error when I run kix script at first time.

is it possible for you to put the files on all dc's in the netlogon?
the no action is just normally the result of not finding the program which in this case is kix32


Sealeopard
(KiX Master)
2002-10-31 04:18 PM
Re: I got error when I run kix script at first time.

Pech:

Please do us a favor and go back to square one!

a) Remove all yoru scripts/files for the domain controller's NETLOGON share.

b) Put a login.bat into the NETLOGON share, e.g. the one in Kixtart Starter's Guide with the call to KiXtart commented out.

c) Have your users call the login.bat

d) Make sure it works.

e) Removed the comment to enable call to KiXtart

f) Use simple KiXtart script to verify that login script runs by e..g displaying a messagebox.

g) Add parts to login script and test.

Also, please be more precise in your answers.


Pech
(Getting the hang of it)
2002-11-01 03:29 AM
Re: I got error when I run kix script at first time.

I have only one DC.
I put PLogon.bat in \\...\netlogon and login it works

If I specify in PLogon.bat
kix32.exe Plogon.kix (not specifiy path)
system command error, coz cannot find kix32.exe and Plogon.kix

If I put Kix32 PLogon.Kix in User Profile..Does not do anything.

Pech


Kdyer
(KiX Supporter)
2002-11-01 04:56 AM
Re: I got error when I run kix script at first time.

Pech,

I see you are having some trouble with deployment/running your scripts..

I would recommend the following as it was interesting exercise for us in how to do an upgrade to KiXtart 4.x..

Starting with your NTLOGON.BAT file, please read:

Q318689 and yes this is a Microsoft article, but is worth the read.

However, if we look at Deployment of Kix Scripts and then look at Page 2.. We see that we can distill or get what we need out of the script.

Once you get your NTLOGON.BAT which is what is commonly named, you can then start working on the KiXtart piece.

Oh, you called yours PLOGON.BAT.

HTH,

Kent

[ 01. November 2002, 04:57: Message edited by: kdyer ]


Pech
(Getting the hang of it)
2002-11-01 09:26 AM
Re: I got error when I run kix script at first time.

I have still an error code : 1208
when I use command to map drive
use H: "\\...\sharename"

How I can handle this error it?


Kdyer
(KiX Supporter)
2002-11-01 02:06 PM
Re: I got error when I run kix script at first time.

Pech,

If we look at the manual for the syntax of how to map a share..

quote:

USE H: "\\SERVER\PUBLIC"

Or, it could be somewhat similar to:

quote:

USE H: "\\SERVER\" + @USERID + "$"

{Edit} - We find what you are looking for:
code:
USE H: "\\bstl_svr3\" + @USERID + "$"

HTH,

Kent

[ 01. November 2002, 14:11: Message edited by: kdyer ]


Waltz
(Seasoned Scripter)
2002-11-01 02:08 PM
Re: I got error when I run kix script at first time.

quote:
One possible cause of this error is that License Manager has not been set up to grant enough connections to meet the clients' demands.



LonkeroAdministrator
(KiX Master Guru)
2002-11-01 02:10 PM
Re: I got error when I run kix script at first time.

so question is, do you have license manager running?

Pech
(Getting the hang of it)
2002-11-04 04:57 AM
Re: I got error when I run kix script at first time.

In Windows NT, 2000 and XP

I have to use command for map drive like this

USE H: "\\server\%username%"

-----------
My Server has licensing manager to control license. And Licensing Log Service is started. If you think like this, may be wrong.

Because First logon.. Failed (Error 1208)
Wait and Run script by manual.. It works!

Pech


Kdyer
(KiX Supporter)
2002-11-04 07:04 AM
Re: I got error when I run kix script at first time.

Pech,

Most Administrators would map drives this way..
code:
USE H: "\\server\" + @USERID + "$"

But you may not be using hidden shares, so it would be:
code:
USE H: "\\server\" + @USERID

The point being, why aren't you using the KiXtart Macros like @USERID?

Kent


Pech
(Getting the hang of it)
2002-11-04 08:03 AM
Re: I got error when I run kix script at first time.

What is a different between?

For Windows 9x
USE H: \\server\@userid

Fow Windows NT, 2000, XP
USE H: \\server\%username%

Right?

Pech


Kdyer
(KiX Supporter)
2002-11-04 02:13 PM
Re: I got error when I run kix script at first time.

One thing, you are missing quotes. [Smile]

It is -
code:
USE H: "\\SERVER\" + @USERID

And again, if you have hidden shares (which would be normal for user information):

code:
USE H: "\\SERVER\" + @USERID + "$"

The other is if you can maintain a consistent standard between 9x and NT-based machines, it will be easier for you.

If you need or must use %username% under 9x, you would than need to do something like -
JSI Tip 1786. Another way to set %UserName%, %ComputerName%, and %LogonServer% for W9x.


HTH,

Kent


Pech
(Getting the hang of it)
2002-11-07 04:34 AM
Re: I got error when I run kix script at first time.

To Kent
I have not any problem with Client Windows 9x.

But In Windows 2000, NT, XP client. I got an error, when I logon at first time : error code :1208

If I wait a few minute and run script by manual, it works. (USE H: "\\server\%username%"), failed only at first login.

Pech


Kdyer
(KiX Supporter)
2002-11-07 08:47 AM
Re: I got error when I run kix script at first time.

Pech,

Let's start with some questions:

Starting from the top..
  • On your Domain Controller (DC), is it up-to-date with drivers, etc.? Have you been to windowsupdate, etc.?
  • What Service Pack is the DC?
  • Anything in the Eventlog related to this or KiXtart in general?
  • Is there space available on the DC if it is being used for other purposes like a file store?
  • Is the network DHCP or Static?
  • Can you PING the DC from the Command Line? By IP? By Name?
  • Has this ever worked properly?
  • User Profiles in Active Directory users and computers - do you specify PLOGON.BAT or PLOGON?
  • > One possible cause of this error is that License Manager has not been set up to grant enough connections to meet the clients' demands.
    Did you setup your license Manager by Client or by Server? If you set it by 25 Clients for example and the 26th logs in, sorry!!
  • Do your users have at least Read and Execute permissions on your NETLOGON folder/share?
You are right, there is no real difference in the environment variables and the KiXtart macros.
But, the macros are easy and quick to use. KiX Macros tend to be more accurate too.

However, the Macros are especially handy with Windows 9x.
If you want to use environment variables outside of Windows and in a DOS Session.
You will need to use:
WINSET.EXE
PUTINENV.EXE

The question being, if you can do this stuff in KiXtart, why use extra utilities?

Now, back on task here..

Using the information that you have told us.. The following has been compiled together.

This is using some ideas from -
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q318689
There are some errors with Microsoft's code, but has good ideas.
  • SETLOCAL..ENDLOCAL don't work with 9x
  • CALL is used in Batch Scripting as well as KiX "CALL"s another Batch Script or KiX script.
PLOGON.BAT
code:
@ECHO off :: -- Note: the correction here
IF "%OS%" == "Windows_NT" goto NT_OS
%0\..\kix32.exe %0\..\PLogon9x.kix :: -- Note: the correction
GOTO END
:NT_OS
kix32.exe PLogonNT.kix :: -- Note: the correction and this should work in NT environments
:: %logonserver%\netlogon\kix32.exe %logonserver%\netlogon\PLogonNT.kix ;-- This is the first alternate way to do this
:: %windir%\kix32.exe %logonserver%\netlogon\PLogonNT.kix ;-- This is an alternate way to do this
GOTO END

:END
EXIT

Left out the 9x script as it appears to work ok..

Added in some more detection
PLogonNT.kix
code:
 ? "Map Network drive (User)..."
IF (GETFILEATTR("H:\") & 16) ; - Check for Drive existence first
USE H: /DELETE
If @ERROR <> '0'
?'ERROR DELETING H: DRIVE ' + @ERROR
ENDIF
USE H: "\\bstl_svr3\" + @userid + "$"
If @ERROR <> '0'
?'ERROR MAPPING H: DRIVE ' + @ERROR
ENDIF
ELSE
USE H: "\\bstl_svr3\" + @userid + "$"
If @ERROR <> '0'
?'ERROR MAPPING H: DRIVE ' + @ERROR
ENDIF
ENDIF

IF INGROUP("MK11")
IF (GETFILEATTR("I:\") & 16)
USE I: /DELETE
If @ERROR <> '0'
?'ERROR DELETING I: DRIVE ' + @ERROR
ENDIF
USE I: "\\bstl_svr3\DocMK11$"
If @ERROR <> '0'
?'ERROR MAPPING I: DRIVE ' + @ERROR
ENDIF
ELSE
USE I: "\\bstl_svr3\DocMK11$"
If @ERROR <> '0'
?'ERROR MAPPING I: DRIVE ' + @ERROR
ENDIF
ENDIF
IF (GETFILEATTR("J:\") & 16)
USE J: /DELETE
IF @ERROR <> '0'
?'ERROR DELETING J: DRIVE ' + @ERROR
ENDIF
USE J: "\\bstl_svr3\ShareDoc"
If @ERROR <> '0'
?'ERROR MAPPING J: DRIVE ' + @ERROR
ENDIF
ELSE
USE J: "\\bstl_svr3\ShareDoc"
If @ERROR <> '0'
?'ERROR MAPPING J: DRIVE ' + @ERROR
ENDIF
ENDIF
; -- If the next line is a windows program, RUN will work
SHELL "\\bstl_svr1\ofcscan\autopcc.exe"
ENDIF
; Before continuing, copy the text from the window and paste
; the information in response here
?"PRESS ANY KEY TO LEAVE"
GET $K
EXIT

We could actually combine PLogon9x.kix and PLogonNT.kix into one script:
KiXtart.kix
code:
 ? "Map Network drive (User)..."
IF (GETFILEATTR("H:\") & 16)
USE H: /DELETE
USE H: "\\bstl_svr3\" + @userid + "$"
ELSE
USE H: "\\bstl_svr3\" + @userid + "$"
ENDIF

IF INGROUP("MK11_LOC") OR INGROUP("MK11")
IF (GETFILEATTR("I:\") & 16)
USE I: /DELETE
USE I: "\\bstl_svr3\DocMK11$"
ELSE
USE I: "\\bstl_svr3\DocMK11$"
ENDIF
IF (GETFILEATTR("J:\") & 16)
USE J: /DELETE
USE J: "\\bstl_svr3\ShareDoc"
ELSE
USE J: "\\bstl_svr3\ShareDoc"
ENDIF
; -- If the next line is a windows program, RUN will work
SHELL "\\bstl_svr1\ofcscan\autopcc.exe"
ENDIF
EXIT

So, if we do that change.. PLogon.bat becomes the following:
PLOGON.BAT
code:
@ECHO off :: -- Note: the correction here
IF "%OS%" == "Windows_NT" goto NT_OS
%0\..\kix32.exe %0\..\Kixtart.kix
GOTO END
:NT_OS
kix32.exe Kixtart.kix
GOTO END

:END
EXIT

Time to go to bed..

Kent

[ 07. November 2002, 08:54: Message edited by: kdyer ]