How to Enable Automatic Logon (AutoAdminLogon) on Windows Server

Windows Server can log a user on automatically at startup, which is useful for kiosks, lab machines, or servers that must run an app in an interactive session. This follows Microsoft’s registry method for turning on AutoAdminLogon.

Security note: this stores the password in plain text in the registry. Use it only where that risk is acceptable.

Steps to Turn On Automatic Logon

  1. Click Start → Run, type Regedt32.exe, and press Enter.
  2. Go to this key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  3. Double-click DefaultUserName, enter the user name, and click OK.
  4. Double-click DefaultPassword, enter the password, and click OK. If DefaultPassword doesn’t exist, create it: Edit → New → String Value, name it DefaultPassword, then set the password. Without a DefaultPassword value, Windows automatically switches AutoAdminLogon from 1 back to 0, disabling it.
  5. Create another string value with Edit → New → String Value, name it AutoAdminLogon, and set it to 1.
  6. Close Registry Editor and restart the computer. It will now log on automatically.

Notes and Troubleshooting

  • Log on as someone else: hold down Shift after you log off or while Windows restarts to bypass automatic logon.
  • Logon banners break it: automatic logon won’t work if a logon banner (legal notice) is set by Group Policy or local policy. Exclude the server from that policy and it works as expected.
  • DefaultUserName gets overwritten: when a different user logs on at the console, Windows saves them as DefaultUserName, and AutoAdminLogon can then fail because the user and password no longer match. A shutdown script that resets DefaultUserName fixes this. See Microsoft KB 119364, “AutoAdminLogon loses DefaultUserName”.