Page 1 of 1 1
Topic Options
#148057 - 2005-09-19 10:53 PM Kix from batch and group policy
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
I'm hoping one of you group policy guru's will be able to help me answer this one.

I've noticed something peculiar about the way kix processes a script inside a group policy object or GPO. Let me give an example.

To start this example lets assume that the netlogon share contains "kix32.exe", "login.bat", and a script called "login.kix". The login.bat file just runs the "%0\..\kix32 login.kix"

Then I try to run a script inside a GPO, also called "login.kix". I'm running this script the same way. "Kix32.exe", "login.bat", and "login.kix" are all stored in the GPO. The only difference is that I'm not using the "%0\..\" Just running "kix32.exe login.kix" in the batch file

For some strange reason it always runs the "kix32.exe" in the netlogon share instead of running the one inside the GPO. Then of course it runs the "login.kix" from the netlogon share instead of the one in my GPO.

Can anyone explain why it behaves like this?

Top
#148058 - 2005-09-20 12:12 AM Re: Kix from batch and group policy
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
simply put, the current directory where the GPO is running is your netlogon directory.
test it by simply adding these two lines before your call to kix:
Code:

cd
pause

_________________________
!

download KiXnet

Top
#148059 - 2005-09-20 03:29 AM Re: Kix from batch and group policy
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The current default directory for the GPO script should NOT be NetLogon. I suspect that your users have the legacy script called from their profile and that the GPO script simply isn't being found.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#148060 - 2005-09-20 08:06 AM Re: Kix from batch and group policy
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
I'm not sure if I'm explaining this properly because your both off the mark slightly. Jooel you are sort of correct in your statement. The current directory inside my GPO is located in the sysvol which then becomes my working directory, but it's not my netlogon share. I think you meant working directory instead of netlogon there.

There is one of two things happening here. Either kix32.exe is executing from the netlogon share (instead of inside the GPO) which then makes my working directory the netlogon share. Thus why the login.kix script runs from there.
Or kix32.exe is executing from inside the GPO, but the script is executing from the netlogon share. I can't explain why it's doing this, I just know it is doing one of those two things.

And Les that is not the case, the current directory for the GPO is on the sysvol not in the netlogon. GPO's as well as any scripts inside a GPO are all stored in the sysvol. There is no legacy script being called. I'm using test accounts for all my testing. They don't run any login scripts at all unless I specifically move the user account into the OU that houses the GPO i'm using to test.

Simply put, if I set a GPO to run a kix script from within a batch file, it should in no way be looking to execute anything from the netlogon share unless I specifically state that in my script. That's why I'm also still leaving the possibility open that this is a strange kix/batch issue when used with group policy objects.

I'm going to do a little more testing to see if this is isolated to kix or if it affects all batch scripts in a GPO.

Top
#148061 - 2005-09-20 09:39 AM Re: Kix from batch and group policy
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
lol.
so, did you add the lines I gave you to your batch file?

no?
so how the heck you can be sure this behavior has anything to do with kix in the first place?

also, if it loads the script from the netlogon, there is only one thing I can think where it can be kixtart doing it.
and that's when it must go searching for the script.
rename your script.
make it login_test.kix as example.
something that isn't in the netlogon and most likely you get "script not found" error.
_________________________
!

download KiXnet

Top
#148062 - 2005-09-20 03:11 PM Re: Kix from batch and group policy
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well... borrowing from the manual.
Quote:

During the logon sequence, KiXtart automatically tries to locate all files that it is asked to open (SPK, WAV, TXT, and so on) by searching for them first on the NETLOGON drive, then on the drive where KiXtart was started from, and finally in the current directory. This behavior can be overridden by prepending the filename with a drive letter or a UNC path.


_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#148063 - 2005-09-20 05:21 PM Re: Kix from batch and group policy
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
Jooel I did not see the need to use your code as I already know the outcome.

Thanks Les, I've read that area before, but unfortunately with group polices the UNC path would look something like this.

\\testrdc\sysvol\microsoft.com\Policies\{083BF3F8-E2AA-4EE8-821F-877B91B0C7D3}\User\Scripts\Logon

Plus I'd have to modify the batch file every single time I use it in a new GPO because the UNC path would change.

The fact that it looks at the netlogon first before looking anywhere else seems like a downfall more than a positive thing. It should be looking at the netlogon last if anything. Your current directory should always be the first place it looks. That's a given in almost all command line processing. Imagine if the command prompt looked at your path statements for the file you specify before it looked in the current directory. Not very intuitive.

Top
#148064 - 2005-09-20 05:38 PM Re: Kix from batch and group policy
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Quote:

Imagine if the command prompt looked at your path statements for the file you specify before it looked in the current directory. Not very intuitive.




That's not a very good comparison as that's the normal action in most mature operating systems. Looking in your current directory first is an extremely dangerous and unwelcome action which has been deplored since it was first implemented in DOS - Trojan Horse anyone

Not that looking in the Netlogon share as a default is much better

Can you use a relative path?

Top
#148065 - 2005-09-20 06:05 PM Re: Kix from batch and group policy
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
Hi Richard,

Relative path is what's causing all the problems in the first place. Kix looks at the netlogon instead of inside the GPO first when you use a relative path.

Top
#148066 - 2005-09-20 08:14 PM Re: Kix from batch and group policy
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I would suggest not to save the KiX executables and the scripts in the GPO\GUID\ folder. Just save the BATch file there. I suggest you setup a folder structure under NetLogon that mirrors the OU structure and place your scripts in there.

You can then call the script from the BATch with:
\\domain.tld\NetLogon\WKix32.exe \\domain.tld\NetLogon\OU\OU\script.kx
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#148067 - 2005-09-20 08:52 PM Re: Kix from batch and group policy
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
again, proper script file names would remove your problem totally.
_________________________
!

download KiXnet

Top
#148068 - 2005-09-20 09:37 PM Re: Kix from batch and group policy
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
Yup that should work Les. Unfortunately, I'm the one who scripts and have no control over where they are placed. In this case, the powers that be place them inside the GPO. So I don't really have a choice.

And Jooel, I don't understand
Quote:

proper script file names would remove your problem totally.




They are proper script file names...since when is login.kix not acceptable? And since when can I not have a script with the same name as one in the netlogon share? It's a variation in the way kix looks for the script. It's not a user error in this case.

I'm going to put this one to bed. Sorry if a seemed a bit snippy through this post, but it was implied that this was something I was doing wrong. Les offered a work around and I'm accepting that.

Top
#148069 - 2005-09-20 10:01 PM Re: Kix from batch and group policy
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well...
you were hursh as well as before.

"I don't consider testing your script as I know it's not gonna prove anything" already proves you are taking steps to wrong direction.
secondly, my suggestion of giving the script a different name (posted before) and replied above you ignored totally as you just didn't like it.
it's properly functioning work around but you just fail to see it.
so dunno...
if I may words sound like I blame you, maybe it's your own head that blames you.
_________________________
!

download KiXnet

Top
#148070 - 2005-09-20 10:40 PM Re: Kix from batch and group policy
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
Yes your option is a valid workaround as well...though no one seems to care that this is a limitation with kix and GPO's. But i guess that's my fault.

I chose not to entertain your code because your code would have given me the long unc path in the sysvol as the current directory. I already knew that. The idea of knowing something is to not have to repeat the process you took to know it in the first place. Hence the reason I didn't try your code.


Edited by cyri (2005-09-20 10:44 PM)

Top
#148071 - 2005-09-20 11:01 PM Re: Kix from batch and group policy
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
cool that you knew it.
I didn't and still don't.
I always doubt before I see with my own eyes.

and I still doubt your word about it.
_________________________
!

download KiXnet

Top
#148072 - 2005-09-21 01:14 AM Re: Kix from batch and group policy
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
Thanks for the vote of confidence.

By the way, the reason I stumbled upon this issue is because I'm testing a new login script. That's why the script names are exactly the same as they are in the netlogon share. Since that is where our current login script executes from. In case anyone wondered why I would do something like this.

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 1471 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.072 seconds in which 0.027 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