Thursday, October 04, 2012 6:37 AM
I want my login . logout handling for all users on a machine to record who is on the machine and the source location.
Context : Remote Desktop
When you remote desktop, environment variable CLIENTMACHINE is set, unfortunately this is NOT set when the group policy login / logout scripts are run, only some time later..
CLIENTMACHINE records the name of the source machine doing the remote desktop.
I found an article http://social.technet.microsoft.com/Forums/en-US/winserverTS/thread/1921fbdf-74db-4252-8d94-a2b3db7707dd which seemed to resolve this but i find Windows 7 does not have a "Run these programs at user logon" setting !
>> Is there another way to run a login script for all users which occurs AFTER the remote desktop login on Windows 7 ? (NB: this is a login issue, not startup)
Friday, October 05, 2012 3:56 AMModerator
You can create a runonce script.
Run and RunOnce Registry Keys
How to Create a Runonce Script
Or create a schedule task for windows 7 and set the trigger to startup.
TechNet Community Support
- Marked As Answer by Greg B Roberts Sunday, October 07, 2012 6:07 AM
Friday, October 05, 2012 6:09 AM
I will trial the runonce approach to see that it works wrt. CLIENTNAME and post back
On the Scheduled Task, front, i see there is a "connect to user session", i will try this as well.
Sunday, October 07, 2012 6:07 AM
The results were interesting,
Using the RUN from the registry worked and showed the CLIENTMACHINE
Group policy login does not show CLIENTMACHINE and occurs AFTER the registry setting
The Schedule task option also did not have a value for CLIENTMACHINE and also i could not get it to run, using the "on connection to user session" option. A manual run of the tasked showed no CLIENTMACHINE value
=> SO the tip that works is the registry RUN option (note in my test i used the HKEY_LOCAL_MACHINE area, not sure if any functional difference to the HKEY_CURRENT_USER)