Run-ShopfloorSetup and Stage-Dispatcher top AutoLogonCount up to 10 so SupportUser survives vendor-forced reboots. Sysinternals Autologon, which lockdown uses to switch the bay to ShopFloor, leaves the counter in place, so ShopFloor inherited the remainder. Windows counts it down on every autologon and at 0 sets AutoAdminLogon=0: the bay boots to a ShopFloor password prompt a few reboots after imaging. Delete the counter once Winlogon shows ShopFloor: - Monitor-IntuneProgress.ps1, on the poll that sees the handover - SetShopfloorAutoLogon.bat, after sfld_autologon.ps1 - Force-Lockdown.bat, on success The SupportUser top-ups stay. Tested in the win11 VM: the Monitor block removes the counter for ShopFloor, keeps it for SupportUser, and is a no-op when clean; both batch files leave ShopFloor autologon on with no counter.
18 lines
734 B
Batchfile
Executable File
18 lines
734 B
Batchfile
Executable File
REM 1) Check if we are running elevated (admin)
|
|
net session >nul 2>&1
|
|
if %errorlevel% neq 0 (
|
|
echo Requesting elevation...
|
|
powershell -NoProfile -ExecutionPolicy Bypass ^
|
|
-Command "Start-Process -FilePath '%~f0' -Verb RunAs"
|
|
goto :EOF
|
|
)
|
|
|
|
|
|
|
|
"C:\Program Files\PowerShell\7\pwsh.exe" -NoProfile -ExecutionPolicy Bypass -File "C:\Program Files\Sysinternals\sfld_autologon.ps1"
|
|
|
|
REM 2) Clear any leftover imaging AutoLogonCount. Imaging tops it up for
|
|
REM SupportUser and Autologon leaves it in place, so ShopFloor autologon
|
|
REM would switch itself off again when it counts down to 0.
|
|
reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoLogonCount /f /reg:64 >nul 2>&1
|