AutoLogon after deployment

When you Create an Answer File, in the Advanced options, on the General tab, you have the option to add AutoLogon credentials using the Autologon after deployment section.



You may enter a domain user in the format domain\username, or you may enter a local user account using the username by itself. The username and password that you specify here will be encrypted in your SmartDeploy answer file, and then passed through to Windows to be used by during Sysprep to automatically log into Windows after deployment is complete. The AutoLogon count will be decremented by 1 with each reboot, so the total number of Autologons will be performed until the count reaches zero, and then the automatic logins will stop.

There is a known Microsoft issue with AutoLogon which causes Windows to add 1 to whatever LogonCount value is specified here, if that value is greater than 0. What this means in practice is that it is not possible to specify a LogonCount of exactly 1. This behavior was the result of a Microsoft design choice, and they have chosen not to change it.

See this Microsoft Learn article for details:
https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-autologon-logoncount#logoncount-known-issue

If you wish to use exactly one AutoLogon, you can switch to the Tasks tab and add this command as an Answer File Task, to occur during the FIRSTLOGON phase:

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoAdminLogon /d 0 /f

A single AutoLogon will occur as specified, but then this command will run automatically, and the LogonCount will be reduced to zero, so a second AutoLogon will not occur.


Was this article helpful?
Still have a question or want to share what you have learned? Visit our Community Discord to get help and collaborate with others.