From a22d2f03131ab522fe795305813ba413a5a79d80 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Fri, 22 May 2026 08:59:22 -0400 Subject: [PATCH] Stage-Dispatcher: top up AutoLogonCount during shopfloor-setup stage Unattend XML sets LogonCount=7 for SupportUser autologon. Each interactive login decrements the counter; at 0 Windows clears AutoAdminLogon and the bay parks at the login screen with no one to fire RunOnce -> dispatcher never re-runs -> imaging chain stalls. Typical imaging burns several logons: Windows OOBE first logon, post-Office reboot, Oracle install reboot, FormTracePak Setup.exe forced reboot, Run-ShopfloorSetup's own shutdown /r at end of script, stage advances. The unplanned FormTracePak reboot pushes the count past 0 on some bays - the exact failure mode the WJF00159 imaging today hit, where Stage-Dispatcher.ps1 had the new defensive RunOnce-re-register fix landed but the dispatcher still never re-fired because there was no auto-logon to trigger it. Top up AutoLogonCount to 10 every time the dispatcher hits the 'shopfloor-setup' stage. Restores the autologon budget across any vendor-forced reboots that fire during the stage. When sync-intune finishes the whole pipeline, AutoLogonCount is left to decrement naturally; by then lockdown's Autologon.exe has set its own AutoAdminLogon for the ShopFloor user. Co-Authored-By: Claude Opus 4.7 (1M context) --- playbook/shopfloor-setup/Stage-Dispatcher.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/playbook/shopfloor-setup/Stage-Dispatcher.ps1 b/playbook/shopfloor-setup/Stage-Dispatcher.ps1 index b9b4fde..15878d6 100644 --- a/playbook/shopfloor-setup/Stage-Dispatcher.ps1 +++ b/playbook/shopfloor-setup/Stage-Dispatcher.ps1 @@ -86,6 +86,25 @@ switch ($stage) { break } + # Defensive: top up AutoLogonCount so SupportUser keeps auto-logging + # in across any vendor-installer-forced reboots during this stage. + # The unattend XML sets LogonCount=7 at install; typical imaging burns + # through several reboots (Office, Oracle, FormTracePak forced reboot, + # Run-ShopfloorSetup explicit reboot, stage advances) and the unplanned + # FormTracePak reboot can push the counter past 0 - clearing + # AutoAdminLogon and leaving the bay parked at the login screen with + # the dispatcher unable to fire. Set the counter to 10 every time this + # stage runs so the budget is restored. When sync-intune finishes the + # whole pipeline, AutoAdminLogon is left to decrement to 0 naturally; + # by then lockdown's own Autologon.exe has taken over for ShopFloor. + try { + Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' ` + -Name 'AutoLogonCount' -Value 10 -Type DWord -ErrorAction Stop + Write-Host "Topped up AutoLogonCount to 10 for SupportUser autologon resilience." + } catch { + Write-Warning "Failed to top up AutoLogonCount: $_" + } + # Defensive: re-register RunOnce BEFORE calling Run-ShopfloorSetup. # Setup chains we don't control (FormTracePak Setup.exe, eDNC MSI, # any vendor installer that forces an immediate reboot) can cut