ERROR: Task could not start because logon failed. / ERROR: Task could not start because Hook window cannot be found.

Applies To: AutoMate 6, AutoMate 5
Published: 8/2/07

Symptoms:

The 'Logon' options located in the 'Managed Task Properties' of each task allow the user to specify under which user context a task should run when it is triggered (started automatically). If a task is set to launch when the system is locked or logged off and the 'Logon' parameters are either "Logon specified user," "Unlock using specified user," or "Run as background user," the error "Task could not start because logon failed" or "Task could not start because Hook window cannot be found" may occur.

Reasons / Solutions:

AutoMate may be attempting to send the keystrokes too soon.
AutoMate attempts to log on a user by simulating the keystrokes a user would use when logging onto the workstation. The keystrokes to simulate are specified in "Logon Keystrokes" and "Unlock Keystrokes" dialog located in 'System' -> 'Options' -> 'Logon Keystrokes' tab. AutoMate automatically sends the keystrokes CTRL+ALT+DEL to begin the logon process. The time between CTRL+ALT+DEL and the actual Windows logon screen appearing may vary with different operating systems and therefore, AutoMate may be sending keystrokes to the username / password fields too soon (before the Windows logon screen appears or is fully loaded). A remedy is to add a delay before AutoMate attempts to send any keystrokes.

Example: {DELAY 3000}{ALT}u{USERNAME}{ALT}p{PASSWORD}{ENTER}

Additionally, there may be some cases where a special security window or "splash' screen may appear after the Windows logon screen but before the desktop. In order to properly close this window / screen, simply enter the appropriate keystrokes to the "Logon Keystrokes" and/or "Unlock Keystrokes" dialog. The example below shows what should be entered assuming that hitting the {Tab} then {Enter} key closes the window:

{DELAY 5000}{ALT}u{USERNAME}{ALT}p{PASSWORD}{ENTER}{DELAY 3000}(TAB}{ENTER}

Keystrokes appear to be missing in the logon screen.
The 'Logon Keystroke Delay' option (located in the 'Logon' tab) is the number of milliseconds that AutoMate pauses between sending each keystroke. By default, AutoMate will press each key of the key sequence every 200 milliseconds (.2 seconds). If the keystrokes appear to be missing during the logon process, adjust this number to a larger amount.

AutoMate is sending the incorrect keys to the logon screen.
On the 'Logon Keystrokes' tab, {USERNAME} is the placeholder for the username as specified in 'System' -> 'Options' -> 'Default User' tab. If a domain name is specified in the 'Default domain/machine name' field of the 'Default User' tab, it is automatically appended to the username and separated with the '@' symbol (i.e. username@domain.com). Therefore, if entering a domain is not required when normally logging in, make sure to leave the 'Default domain/machine name' field blank.

The user specified does not have proper privileges to run the task.
The Default User specified in the 'System' -> 'Options' -> 'Default User' tab is used where a username and password may be required in order to run a task (such as when a managed task is set to log on a logged off workstation). In addition, AutoMate can run a task as a "Specified User' (accessible via the 'Logon' tab by selecting the 'Specified User' button). Make certain that the user account specified has the proper privileges to run the task and that the user has full read/write permissions to the following folder on your system: C:\Documents and Settings\All Users\Application Data\Network Automation\AutoMate 6.

A newly created user account was never manually logged onto the machine.
The error can occur if the specified user is newly created and there were no attempts made to manually log the user onto the machine. Performing a manual login for a new user account creates the appropriate registry keys that may be necessary for Automate to successfully run the task.

Notes:

Ultimately, the best method to determine the root cause of the error is to make sure you are in front of the physical machine where AutoMate resides (as opposed to a remote session). Schedule the task to launch a few minutes into the future. Thereafter, lock or log out of the machine and watch your monitor to determine exactly what happens when the task launches.