Bump AutoLogonCount from 2 to 4 for reboot margin
The imaging chain needs exactly 2 autologons after the first boot (sync_intune pre-reboot + post-reboot). Setting to 4 adds 2 extra reboots of margin for unexpected restarts from Windows Update, PPKG file operations, or script crashes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -199,9 +199,11 @@ if (Test-Path -LiteralPath $enrollScript) {
|
|||||||
Write-Host "run-enrollment.ps1 not found - skipping enrollment."
|
Write-Host "run-enrollment.ps1 not found - skipping enrollment."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set auto-logon to expire after 2 more logins
|
# Set auto-logon to expire after 4 more logins (2 needed for sync_intune
|
||||||
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoLogonCount /t REG_DWORD /d 2 /f | Out-Null
|
# pre-reboot + post-reboot, plus 2 margin for unexpected reboots from
|
||||||
Write-Host "Auto-logon set to 2 remaining logins."
|
# Windows Update, PPKG file operations, or script crashes).
|
||||||
|
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoLogonCount /t REG_DWORD /d 4 /f | Out-Null
|
||||||
|
Write-Host "Auto-logon set to 4 remaining logins."
|
||||||
|
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
Write-Host "================================================================"
|
Write-Host "================================================================"
|
||||||
|
|||||||
Reference in New Issue
Block a user