Page 1 of 1 1
Topic Options
#213210 - 2018-03-01 01:47 PM KiX script not running right when user is in adminstrators group.
LuukOV Offline
Fresh Scripter

Registered: 2018-03-01
Posts: 5
Loc: NL
After long research I found out why in some cases the kix script doesn't work.
I found out that it occurs when users are in the local "administrators" group.
The scripts runs in any case, I see it does, I have deployed the script as a login script in a GPO. When I debug it looks fine and gives me no errors, all steps are taken but mappings just are not created.

But if I run the same script manually on the same user it all works fine! And users who are not a member of the local "administrators" group, these problems do not occur, I do not have to run the script manually.

So this is stranged thing I have ever seen. I tried it on different servers, different customers and different versions of kix with the same results so I assume everyone does have this problem? Tried it on Windows Server 2008R2, 2012R2 and 2016.

I do not know if this occur with all commands but I am sure it happens with the "use"-command. Which are used for creating mappings.

Anyone who can solve this?


Edited by LuukRBK (2018-03-01 02:09 PM)

Top
#213212 - 2018-03-01 03:00 PM Re: KiX script not running right when user is in adminstrators group. [Re: LuukOV]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4560
Loc: USA
Is this a logon script or startup script?

It sounds like it might be a startup script. If this is the case the script is running as SYSTEM. You have a couple of options...

1. Create a hybrid startup and login script. Startup for admin things, and logon for user related things.
2. There is RunAsInteractiveUser. This is a UDF that has been pretty thoroughly tested by the kixtart community.

There is another way that involves a registry hack, but I'm not going to advise you go that direction.

RunAsInteractiveUser -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=198514#Post198514
(go to the bottom of thread to get most current version)

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1

Top
#213213 - 2018-03-01 03:25 PM Re: KiX script not running right when user is in adminstrators group. [Re: Allen]
LuukOV Offline
Fresh Scripter

Registered: 2018-03-01
Posts: 5
Loc: NL
Thanks for your reply. It is a Logon script.
You can simulate this problem if you have a test environment

config a server. config a loginscript. add it to a user in profile tab or config GPO Logon script.
add a network mapping to the script. (use f: "\\server\data")
Logon to a server with the user. All OK, mapping created.
after that add the user to the "administrators" group on that server. logoff and logon again. I think you got the same issue, no mapping created.
This seems to happen on RDS (TS) servers.

if you run only the script manual then there is no problem.
I have configured "wait for network" etc. but that doesn't make difference.



Edited by LuukOV (2018-03-01 04:39 PM)

Top
#213214 - 2018-03-01 05:02 PM Re: KiX script not running right when user is in adminstrators group. [Re: LuukOV]
LuukOV Offline
Fresh Scripter

Registered: 2018-03-01
Posts: 5
Loc: NL
I have made a video to make this issue clear:
https://drive.google.com/open?id=1bl2v5tzMuiK8NiBlh7Vy1dWr5fk5V3Go

Top
#213215 - 2018-03-01 06:08 PM Re: KiX script not running right when user is in adminstrators group. [Re: LuukOV]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4560
Loc: USA
You are one of a handful that have had this problem. I have users in the administrators group and it does not do this.

Please check the following in the registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
EnableLinkedConnections

If it is set to 1 try setting it to 0.

Top
#213216 - 2018-03-01 09:49 PM Re: KiX script not running right when user is in adminstrators group. [Re: Allen]
LuukOV Offline
Fresh Scripter

Registered: 2018-03-01
Posts: 5
Loc: NL
 Originally Posted By: Allen
You are one of a handful that have had this problem. I have users in the administrators group and it does not do this.

Please check the following in the registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
EnableLinkedConnections

If it is set to 1 try setting it to 0.


Wow you are good man.
It works now. There was no registry item "EnableLinkedConnections" I created it and set it to 1. after a reboot it works! Thanks!!!

You must know how mutch time it had cost to find it out why the logon script doesn't work for some users haha.

I am going to test is for a while and on different servers. I come back to you later.


Edited by LuukOV (2018-03-01 10:02 PM)

Top
#213217 - 2018-03-01 10:18 PM Re: KiX script not running right when user is in adminstrators group. [Re: LuukOV]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4560
Loc: USA
I don't want credit for what you did. Setting it to 1 is not supported by Microsoft and who knows what issues you will have in the future. Do a search on the board for EnableLinkedConnections and you find more info on it. Yes it works... but with a big BUT...


Using the RunAsInteractiveUser is a better solution in my opinion.


Top
#213218 - 2018-03-05 10:54 AM Re: KiX script not running right when user is in adminstrators group. [Re: Allen]
LuukOV Offline
Fresh Scripter

Registered: 2018-03-01
Posts: 5
Loc: NL
I found this on the microsoft site:
https://support.microsoft.com/nl-nl/help...-when-uac-is-co

Detail to configure the EnableLinkedConnections" registry entry
In Registry Editor, locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
Right-click Configuration, click New, and then click DWORD (32-bit) Value.
Name the new registry entry as EnableLinkedConnections.
Double-click the EnableLinkedConnections registry entry.
In the Edit DWORD Value dialog box, type 1 in the Value data field, and then click OK.
Exit Registry Editor, and then restart the computer.

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
1 registered (Allen) and 1005 anonymous users online.
Newest Members
min_seow, Audio, Hoschi, Comet, rrosell
17881 Registered Users

Generated in 0.057 seconds in which 0.012 seconds were spent on a total of 13 queries. Zlib compression enabled.

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