How to Enable Autologon for Domain-Joined Windows Servers and Workstations

Tuesday, April 29, 2008

Update: I've confirmed that the following procedures also work for all versions of Windows and Windows Server.

In a previous post I showed how to enable Autologon for workgroup servers and workstations.

Once you join a server to a domain, Windows will automatically delete the AutoAdminLogon value from the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon registry key. This causes the userpasswords2 control to hide the "Users must enter a user name and password to use this computer" check box shown above.

Here's how to get the missing checkbox back and configure AutoLogon:
  • Open an elevated CMD prompt and enter the following (all on one line):
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d "1" /f
  • Click Start, Run and enter control userpasswords2
  • Clear the checkbox for Users must enter a user name and password to use this computer and click OK
  • Enter the user name and password that will be used for automatic logon and click OK
You may find that you need to configure the default domain, as well.  If so, enter the following (all on one line) at an elevated CMD prompt:
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /t REG_SZ /d %USERDOMAIN% /f
When the computer starts up the account you specified will be logged in automatically.  Note that the password is encrypted on the computer.

This tip works for all versions of Windows desktops and servers.

Since you're here, be sure to check out my article about building a super-fast Windows Hyper-V lab server for under $1,000!


  1. Yeah, that Logon expert stuff is spam.

    If you want to automate auto-logon, then see this sys-internals tool:

  2. Thanks, Ryan. I deleted the spam comment. I usually catch these before they get posted.

  3. Unfortunately none of the 2 suggestions worked on HPC Edition of Server 2008; anything special blocking this in the registry of this ditro?

  4. Sorry, you can't get there from HPC Edition. It lacks the binaries for the Windows Desktop Experience, which Aero requires. See

  5. Worked first time for me!!!!!!!!
    Thanks for the tip

  6. Thank you. Very helpful!

  7. Worked for me! I have Windows Server 2008 R2 Standard.


  8. Worked for me on the primary GC server. Thanks !!

  9. Excelent Thanks! work in Windows 2008 Terminal Server

  10. Yep! Worked for Foundation Edition R2 2008

  11. you also need to add DefaultUserName
    and set AdminAutoLogon to 1
    then when you run "control userpasswords2" you'll be able to set the logon username/password (event if you're in a domain).

  12. If you are already in the registry, just add the following keys as well to the same keys:
    AutoAdminLogon 1
    DefaultUserName Administrator
    DefaultPassword Password


  14. everytime I change the Value of AutoAdminLogon to "1", it is changed back after every restart to "0" :(

  15. You can create a .reg file and then execute it.

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]

  16. I created a .bat file out of these instructions to make using this at a later time easy. Copy/paste this into a textfile and rename that file to xxxx.bat (where xxxx can be anything you like, as long as windows likes it too, eg, no : / etc...)

    This script is tested on a win 2008 R2 server.
    @echo off
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d "1" /f >nul

    echo In the following dialog, check and uncheck the
    echo "users must enter their username and passwords to login", and hit apply.
    echo Specify the username as: DOMAIN\Username or it will attempt to logon
    echo locally.
    set /p q=Press {enter} to continue.

    control userpasswords2

  17. This technique, and the previously posted batch file have been succesfully tested on Windows XP. I'm fairly certain that this won't work on windows 2000 though.

  18. Thanks Ipchip

    Worked like a charm! :D

  19. Got it done in 5 minutes! THANK YOU!

  20. Got it done in 5 Minutes. THANK YOU!!

  21. Also make sure that SYSTEM has Full Control permissions on HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

  22. Many Commenters are suggesting just entering the registry commands including the DefaultPassword entry. (security violation in most companies!) The "Control userpasswords2" command will encrypt the password and keep security happy(er)!

    I also find the the normal autologon configuration procedures will fail in Windows Server 2008 R2 until I added the following registry entry. Done throu an administrative command prompt in this case:

    Reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\winlogon” /t REG_DWORD /v ForceAutoLogon /d 1 /f

  23. Worked for me first shot, and the auto login was onto a domain network, now when guests are around i dont need to log the machines on of a morning :)

  24. Windows Server 2008 R2 in workgroup was set.
    And this not work. Why?
    On my Windows 7 control autologon by AutoAdminLogon, 1 or 0.
    The DefaultPassword parameter in the register isn't present on win2008 and win7.

  25. Why logon expert is spam? I tried it and it's really do everything that advertised and no password in registry as your method does... strange classification of spam


Thank you for your comment! It is my hope that you find the information here useful. Let others know if this post helped you out, or if you have a comment or further information.