Page 1 of 1 1
Topic Options
#205939 - 2012-10-08 04:50 PM Kix wait until explorer loads
Salva Offline
Just in Town

Registered: 2012-09-21
Posts: 2
Loc: Spain
Hi,

I'm dealing with a particular problem when mapping drives for users at logon.
I created a script that looks for particular AD groups and then maps drives according them. The problem is not the script itself, since it works fine "most" of the times.

The net use command shows that drives are mapped correctly, but some of them are not listed on windows explorer (My Computer). This seems a Windows issue, since killing explorer process and restarting it again lists all drives as it should. Even from Task Manager, you go to File-> New Task (Run...) and type drive letter and it opens shared resource.

Is there anything I can do, for example insert a "wait until explorer completely loads" command, as my guess is that mapping process starts before all windows processes finish loading? I noticed this at least with Windows 7 Enterprise workstations.

regards,
Salva.

Top
#205940 - 2012-10-08 05:10 PM Re: Kix wait until explorer loads [Re: Salva]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Do you run your logon script synchronously?
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#205944 - 2012-10-08 05:54 PM Re: Kix wait until explorer loads [Re: Mart]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Welcome to KORG!

There are two group policy settings that I always use to insure that login scripts work flawlessly. Run Synchronously, as Mart suggested, and Wait for the Network to start.

The default settings help the "perceived" performance of the Windows desktop. Asynchronous script processing lets the desktop display before the login script completes, or even runs in some situations. Forcing it to run Synchronously insures that all of the login script script processes complete before the user can get to the desktop and do anything.

The Wait for Network also allows the system desktop to display before the network is operational. Enabling this policy setting insures that IP is running, DNS is available, and the network fully functional before trying to run the login script and allow the user to do anything. This policy provides little benefit in its default (off) state nowadays, since pretty much everyone relies on network services.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206215 - 2012-11-14 12:25 PM Re: Kix wait until explorer loads [Re: Glenn Barnas]
Salva Offline
Just in Town

Registered: 2012-09-21
Posts: 2
Loc: Spain
Hi both, thanks for your help!

To clear up things, the option "Run Synchronously" means to start the script by adding START /B /W WKIX32.EXE to the scriptpath box in Active Directory?

I will change this with powershell since i currently have the path
"kix32.exe loginscript.kix"

The second option, may be the one located under the GPO tree: Computer Configuration (Enabled) -> Administrative Templates -> System/Logon -> Always wait for the network at computer startup and logon

We also discovered this option which we have by default, but after reading explanation we were not sure whether this setting could help or not.

Regards,
Salva.


Edited by Salva (2012-11-14 12:35 PM)

Top
#206217 - 2012-11-14 01:34 PM Re: Kix wait until explorer loads [Re: Salva]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
http://technet.microsoft.com/en-us/library/cc962720.aspx
_________________________
!

download KiXnet

Top
#206219 - 2012-11-14 03:37 PM Re: Kix wait until explorer loads [Re: Salva]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
No - "run login scripts synchronously" is a GPO setting as Lonkero indicated. Do not change your user profile settings.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206224 - 2012-11-14 04:34 PM Re: Kix wait until explorer loads [Re: Glenn Barnas]
Robdutoit Offline
Hey THIS is FUN
***

Registered: 2012-03-27
Posts: 363
Loc: London, England
I used to have this problem, but no longer do. Unfortunately with all the changes that I have made over the last few months, its impossible to isolate exactly what the cause was, but I will tell you what I do now.
I use kixtart version 4.62 and I run it from the logon script in the gpo, not from the script tab in the users profile in active directory. Windows 7 and uac doesn't like running from the netlogon folder. use the group policy to run the script.
I don't use the run scripts synchronously as I don't seemt to need it. I also map the drives for the session i.e. not persistent as the persistent setting causes problems with windows 7.
If you are running as local administrators, then you will need to enablelinkedconnections in the registry as it won't work on windows 7 as a local admin because of uac.
Another thing that I do is load all the registry settings first in my script and then do the changes that require explorer to be loaded such as mapping drives etc.

I also use this code at the beginning of the script to make the script wait until the user profile is loaded.

 Code:

? " User logged on is " @userid
While
@UserId = ""
sleep 0.3
? "Sleeping for 300 milliseconds"
Loop


Hope that something here helps

Top
#206225 - 2012-11-14 05:05 PM Re: Kix wait until explorer loads [Re: Robdutoit]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
 Originally Posted By: Robdutoit
Windows 7 and uac doesn't like running from the netlogon folder.
What?

I have clients with anywhere from 3 to several thousand Win-7 desktops that run login scrips from NetLogon (standard logon, not GPO) without any issue. The majority have UAC enabled and most users are not local admins.

Running scripts synchronously doesn't generally solve problems. Its often used to insure that the login script completes configuration of the user environment prior to loading the desktop and allowing the user to muck around. If your login script takes more than a few seconds to run, a user can load and run apps before all resources are available. Running the script synchronously prevents this.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206227 - 2012-11-14 06:16 PM Re: Kix wait until explorer loads [Re: Glenn Barnas]
Robdutoit Offline
Hey THIS is FUN
***

Registered: 2012-03-27
Posts: 363
Loc: London, England
Now that you mention it, the reason that I moved away from running the script from the netlogon folder was because the script was not setting the policies in restricted registry keys. It worked if the script run from the gpo, but not from the active directory userprofile tab. I don't know if that issue would still apply with my new and much improved script, but that was the reason why I moved away from using the netlogon foldera about 3 years ago. If you don't apply policies to restricted reg keys then obviously you would not have this problem. But then having said that, I see very little reason to run the script from the userprofile tab. The gpo startup and logon and logoff are far more useful.

I don't run my scripts synchronously as I never really needed it for my scripts, but I may use it at some point to address the issue of updating the firefox profiles, as there it would be a benfit to wait until the script is run first before seeing the desktop. But my main point I was making is that running synchronously will not fix his issue with drives not being mapped every time as I don't think that the problem is whether the script is run sychronously or not.

Top
#206229 - 2012-11-14 10:54 PM Re: Kix wait until explorer loads [Re: Robdutoit]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
As I said, running sync usually won't solve problems.. Next question is why you're using (login) scripts to set restricted registry values? Shouldn't they be set with GPO instead of script? Sounds like you're shoe-horning an admin task into the user login process.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206230 - 2012-11-15 12:10 AM Re: Kix wait until explorer loads [Re: Glenn Barnas]
Robdutoit Offline
Hey THIS is FUN
***

Registered: 2012-03-27
Posts: 363
Loc: London, England
Ya, so we are agreed on the synch issue. I like using scripts instead of GPO's for a number of reasons. The top of the list would be the following:
Logon time with scripts much faster than gpo's
It is so much quicker to find the setting to change in the script than hunting for it in the gpo's.
copying one script to all my clients is as simple as copy and paste. Copying the gpo settings from one client to the next, while not difficult is not as quick as copy and paste for the script.
Customisability is a huge one if you have clients with different operating systems which I have had over the years, although all my clients are now on windows 7.
A script can do everything, whereas with a gpo, there are some things that only a script can do!
I think this issue is kinda like windows versus mac or chrome versus firefox. I just don't like GPO's as I find scripts can do more for me. The script that I have now does absolutely everything I want it to do.

I only need 8 restricted registry keys to be set per user, hence my post called "step by step guide to running script with elevated privileges" or whatever I called the post.

anway, not to distract the OP from the original question as the poor man needs his mapped drives lol

Top
#206232 - 2012-11-15 07:02 AM Re: Kix wait until explorer loads [Re: Robdutoit]
rectina Offline
Just in Town

Registered: 2012-11-14
Posts: 1
Loc: Alaska
Is there anything I can do, for example insert a "wait until explorer completely loads" command
Top
#206233 - 2012-11-15 01:39 PM Re: Kix wait until explorer loads [Re: rectina]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sure...
if explorer.exe is running, it's loaded.
you can wait for that.

this is obviously completely opposite than the GPO runsync stuff.
_________________________
!

download KiXnet

Top
#206234 - 2012-11-15 07:39 PM Re: Kix wait until explorer loads [Re: Lonkero]
Robdutoit Offline
Hey THIS is FUN
***

Registered: 2012-03-27
Posts: 363
Loc: London, England
I think that you are focusing on the wrong thing. Explorer is not the problem in the sense that you don't need to wait until explorer loads nor to map the drives before explorer loads. Something else is going on. You need to provide more information. Is this on windows 7, xp, is this on new machines, old machines, does the script run at all when the drive mapping fails, are your drive mappings persistent. Ignore the issue of having to restart explorer. Explorer should not be the problem, but without more information its kinda hard to say what the problem is.
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 1782 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

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