First process to start after you login to an XP machine

I have a script that checks to see what user is logged into an xp machine.  This runs locally on the machine.  I look for a registry setting to get the userid.  To make sure they are really logged in I also check to make sure explorer.exe is up and running.  The problem I have it we have a bunch of slow computers that take a long time to log into.  This can actually take a few min if it's the first time they are logging into this machine to setup their profiles.  This means that the explorer.exe does not start until about the end of the login process.  Is there a better process I can look for to make sure a user is really logged in that comes up faster than explorer.exe?  I need to get this as close to real time as I can.
chadmanvbAsked:
Who is Participating?
 
CodeCruiserCommented:
You can use logon and logoff scripts.

http://msmvps.com/blogs/kwsupport/archive/2005/02/24/36942.aspx

http://community.spiceworks.com/scripts/show/70-track-login-and-logout

You can write any VBScript code and set it to run on logon/logoff using ActiveDirectory.
0
 
athomsfereCommented:
Perhaps winlogon.exe is a better exe to watch for?

As for looking for the user logged on, have you looked at PStools?

psloggedon \\PcName will give you all users and accounts logged in, you can also filter it with a findstr to find specific users of the domain or by name.
0
 
chadmanvbAuthor Commented:
Thanks, let me try that exe and I'll let you know.  I have tried PStools, but the results were not very consistent.  I have tried a bunch of way to get the current users, using wmi, registry, checking for a process, ect.  I open for any other ideas that work.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
chadmanvbAuthor Commented:
It looks like winlogon stays running after a user logs off.  Any other ideas?
0
 
CodeCruiserCommented:
>I have a script that checks to see what user is logged into an xp machine.

Is it a startup script? How is it run?
0
 
chadmanvbAuthor Commented:
It's called by a service run under system.  The script looks at the registry hive and looks for the user in Volatile Environment.  This seems to work 100% of the time, but sometimes this does not unload after the user logs off.  So I look to see it windows explorer is also running.  If so, I can assume the user is logged in.  If not, I know they must have logged off.  I tried some other ways to get the user, but have never had great results, such as wmi, and pstools,

I have about 400 test computers and my goal is to try to get real time information on what computers are available for users to log into.  Currently I have this script run locally on each machine every 30 seconds and writes to an sql table.  Any better ideas would be great.
0
 
chadmanvbAuthor Commented:
Code, That works, but I still have to wait for them to start.  I was trying to find a process that starts before explorer.exe that I can look for.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.