Demystifying the LoginAM startup task

The starting point of LoginAM is the startup task (a windows scheduled task). Almost every functionality of LoginAM is started directly or indirectly by this task. But what does it do? This is something usually discussed in training sessions at customers as part of a more comprehensive training. But even with the more advanced administrators that use LoginAM the knowledge of the task isn’t great. Which really is a pity because when you understand the startup task it makes troubleshooting and creating more complex packages much easier.

An overview

Since its the starting point for a lot of the functionality of LoginAM it isn’t something that is easily explained. I’ve made a flowchart to get an overview of the startup task. To keep the overview compact I’ve removed the imaging plugin. I’ll write a blogpost about this later.

LoginAM Startup Task
LoginAM Startup Task


I’ll go through the different steps and give you an explanation along the way.

Cache update & computer policy updateAt every boot the LoginAM cache is updated. All other tasks are executed from the cache. Also the computer policy is updated to make sure these are the current policies.
Is deployment flag trueThis flag can either be set manually or if the previous reboot was a so-called deployment reboot. This flag indicates if the deployment plugin may run.
Shortcuts: clear shortcutsThe shortcut cache is cleared. Later on these are filled again with the latest shortcuts that are configured within the packages.
System configuration: check and create OU & Move machine to OU.The system configuration plugin creates the configured OU if needed and moves the machine to this OU if it isn't already in the OU.
Process for each packageFor each individual package the separate plugins are executed.
Computer policy updateAnother computer policy update is executed.
Check if reboot is requiredIf one of the packages executed invokes the reboot actionitem further execution of packages is halted and at this point this reboot is executed.
Is windows update integration enabledIf all packages have been executed and windows update execution is enabled updates will be installed.
Check if reboot is requiredIf any of the updates requires a reboot this will be executed
Set deployment flag to falseIf all packages and windows updates have been installed and no more reboots are required the deployment flag will be set to false


Package process

That covers the overview of the entire process. But it’s interesting to zoom in specifically on the “Package process”. For each package all plugins are executed each time the startup task is run. The only plugin that is able to perform a reboot is the deployment plugin. This plugin is the only plugin that runs only once. In the registry (HKLM:\Software\Automation Machine\Tracking) is saved which packages have already processed the deployment plugin this is called the tracking cache. If the deployment plugin initiates a reboot the package process is stopped and the machine immediately receives the reboot. Upon startup the Startup task starts again. Each task is run as it would normally and only the deployment plugin will start where it has left off thanks to the tracking cache. This process is repeated until all packages have been installed. Since the deployment plugin encompasses more then that and the other plugins also have a lot of features I’ll cover that in a separate blogpost.

I hope this was an informative post, if you have any questions please don’t hesitate to leave a comment.

Leave a Reply