views:

133

answers:

1

Background: I have a JScript that runs when the computer starts up (from task scheduler). The script does some magic and determines if a user should be allowed to login at all. It starts by disabling all user accounts and then if a user is to be allowed in it enables the users account by firing the 'net user' command using wshShell.Exec(). All this works well and the accounts are correctly enabled/disabled.

Problem: However the vista graphical login screen has no idea that user accounts have been enabled/disabled and does not refresh itself to show/remove the user account pictures. Actually it does refresh itself if I wait long enough at the login screen to start the screensaver. When the mouse is then moved the visa login screen returns refreshed. However I want to be able to restart/refresh the login screen from my script. Any ideas?

What I have already tried:

  1. I tried launching winlogon.exe from the script, it had no effect
  2. I tried launching logon.scr from the ecript to trigger the screensaver manually, it did not trigger.

If you need the script, look here: http://code.google.com/p/truecryptautomount/

+1  A: 

Anything you do from the service's context will not affect it as the login screen is an entirely different session/desktop. This is a security feature designed to stop user programs from emulating the login screen to capture a password. CTRL+ALT+DEL will always bring you to this alternate desktop/session.

The screensaver you are starting is not the same one you see start on the login screen. With that in mind, you should be able to configure the screensaver for the system account's profile to have a very short wait time. You can probably learn what you need to know from this article:

http://blogs.technet.com/heyscriptingguy/archive/2006/03/08/how-can-i-configure-the-screensaver-used-when-no-one-is-logged-on-to-a-computer.aspx

Hope this helps,

-Oisin

x0n
An indirect solution, it will still require the user to wait for the screensaver to start. I wonder if it is possible to launch the screensaver manually using runas command. Is there a system level 'user account' associated with the login screen?
Ali
Yes, you can sometimes see that user in task manager's process list - running logon.scr.You could try using psexec - http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx - take a closer look at the -i and -s parameters for interact with session and run as system respectively.
x0n