title: How to autologin by altering Windows Server 2012 R2 registry? "AutoAdminLogon" solution doesn't completely work
body: <p>I'm trying to set up a Windows Server 2012 R2 machine to logon automatically on startup - I have done this successfully in other Windows OS's but I'm having issues applying the same method on Windows Server 2012 R2.</p>
  
  <p>The problem is that on startup the Windows Server machine will show me the Desktop momentarily, and afterward it will automatically log me out again and require that I enter my password to access the Desktop.</p>
  
  <p>I'm using Chef to manage my configuration, and while I doubt Chef is causing any isssues, here is the Chef code I'm using to setup up the AutoAdminLogon (including the Powershell based method of setting up AutoAdminLogon):</p>
  
  <pre><code>powershell_script 'Autologin (no password entry required)' do
  code &lt;&lt;-EOH
      $RegPath = "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"
      $DefaultUsername = "Administrator"
      $DefaultPassword = "MyPasswordHere"
      Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1" -type String 
      Set-ItemProperty $RegPath "DefaultUsername" -Value "$DefaultUsername" -type String 
      Set-ItemProperty $RegPath "DefaultPassword" -Value "$DefaultPassword" -type String
  EOH
  action :run 
  end
  </code></pre>
  
  <p>I've checked the registry and everything has entered into the registry correctly, also I've checked and no startup tasks are present and there's nothing in my "shell:startup" folder that would cause this behavior. What might be going wrong?</p>
  
  <p>Thanks!</p>