Auto login Windows Server 2012

53

25

Hey all i am hoping someone knows how to set up Server 2012 with auto logon?

I already tried: winserver2012

But i am unable to find the checkbox that was in 2008 server that said "Users must enter a user name and password to use this computer."

Where else can i go/do in order to do this auto login?

StealthRT

Posted 2012-11-05T00:38:57.880

Reputation: 956

Answers

45

Try to use the registry key technique.

You will need to have an account with a password for this to work.

  1. Run regedit.exe

  2. Navigate to

    HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon
    
  3. Set or create the following keys

    (DWORD)  AutoAdminLogon = 1
    (String) DefaultUserName = Your user name
    (String) DefaultPassword = Your password
    
  4. Restart and let us know if it works!

Mikhail

Posted 2012-11-05T00:38:57.880

Reputation: 3 782

33

Autologon from Sysinternals should do the trick. It’s really simple too.

cem2ran

Posted 2012-11-05T00:38:57.880

Reputation: 431

2While the question relates to the original Server 2012 this is the only method that still seems to work under R2. – PeterJ – 2014-11-05T06:41:24.777

This isn't working on Windows Server 2012 R2 Standard. – Sathish – 2016-05-05T13:52:27.120

Worked fine for me on R2 Standard today – bendecko – 2016-10-25T16:51:09.617

after installing you need to run autologon $env:UserName $env:UserDomain vagrant in admin powershell to enable it – wal – 2019-09-21T02:05:29.007

31

I would not manually edit the registry. Use the netplwiz.exe app that comes standard with 2012 (and 2008 as well). This opened the following User Accounts box for me.enter image description here

Just search for the app through the start menu, or travel to C:\Windows\System32 to find it

John Smith

Posted 2012-11-05T00:38:57.880

Reputation: 419

7For the ones as dumb as myself, you need to CLEAR "Users must enter a user name and password to use this computer" and it will ask for a password in which will make the server auto logon. – Francisco Aquino – 2014-10-19T02:12:37.137

2This option is not available in Windows 2012 R2. – Erikk – 2015-06-19T23:42:27.993

1The option is not available on a network DOMAIN, until AutoAdminLogon is set as described in the other posts. – woodvi – 2016-06-20T17:32:33.253

I agree this is probably the best way of doing this. – Lukasz – 2017-10-12T21:10:30.320

And it appears that the password is not stored in the clear in the registry when you do it this way. A far better way of doing it. – Matt H – 2014-01-13T01:00:55.200

9

Go to CMD and type "control userpasswords2". If you can see the "Users must enter a user name and password to use this computer" checkbox then uncheck it and Apply/Ok and enter your credentials.

However, Windows does not always show the "Users must enter a user name and password to use this computer" checkbox. For instance if your PC is joined to a domain.

If you use the full registry method, then your password will be saved in plan text, which could be a security issue. To get around this you can force the checkbox to appear no matter what.

  1. Open the registry and navigate to "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon".
  2. Create ONLY the String "AutoAdminLogon" with a value of "1".
  3. Close the registry editor and open a CMD prompt.
  4. Type "control userpasswords2" without the quotes.

You will now see the same dialog the OP posted but with the checkbox "Users must enter a user name and password to use this computer" and it will be unchecked.

  1. Re-check the box and hit Apply.
  2. Then uncheck it again and hit Apply or OK and save your UID and PWD.

The machine will auto login, without storing your credentials in the registry in plain text. If you had previously did the full registry method before with UID and PWD I would delete them before doing this, however checking the box might delete the keys for you.

If the PC is a DC or Domain member than you may need to configure the login domain registry entry before it will work properly.

Brian D.

Posted 2012-11-05T00:38:57.880

Reputation: 219

Easy and quick! (I found the checkbox in the first place :) – Jako – 2016-09-30T08:28:13.263

4

I think this is easiest to do from PowerShell...

Type:

PS:> $RegPath = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"

PS:> Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1" -type String

PS:> Set-ItemProperty $RegPath "DefaultUsername" -Value "YOURDOMAINNAME\Administrator" -type String

PS:> Set-ItemProperty $RegPath "DefaultPassword" -Value "YOURPASSWORD" -type String

I don't know if that's easier overall, but it's something you can do from a remote PowerShell session. To my mind that makes it much more accessible.

Ejoso

Posted 2012-11-05T00:38:57.880

Reputation: 255

If you receive an error when running this command, you may need to add the ItemProperties before you attempt to set them.

New-ItemProperty -Path $path -Name $key -PropertyType "STRING" -Value "VALUE" – Nick Painter – 2019-01-23T18:32:34.073

1

if you need to keep your logon password encrypted (AES256), take a look at LogonExpert autologon tool: http://www.logonexpert.com Yes, this tool is paid one, but it contains a lot of useful features, not just simple auto login at Windows start-up. Some of them I personally use:

  • Scheduled logon/logoff (every morning with computer auto wake-up and auto logoff with putting computer to sleep every evening)
  • Auto unlock and auto re-logon
  • Server based batch files on scheduled events (Windows scheduler) for remote logoff and logon specified user on the computers network wide (via LogonExpert command line le.exe + psexec)

Serg N.

Posted 2012-11-05T00:38:57.880

Reputation: 11

1

You must replace or create the following keys in registry :

HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon

AutoAdminLogon = 1

DefaultUsername = currentUserName

DefaultPassword = currentPassword

Reference : http://techsultan.com/autologin-on-windows-server-2012/

Sultan

Posted 2012-11-05T00:38:57.880

Reputation: 11

1

if you only set "AutoAdminLogon = 1" you will get your checkbox back for "Users must enter a user name and password to use this computer.".

That way you don't have to do too much in the registry.

Michele Possamai

Posted 2012-11-05T00:38:57.880

Reputation: 11

Didn't work for me. Checkbox still is not shown. – LPChip – 2016-05-12T11:29:15.880