Does anyone know a (verified) method to cause a specific user to auto-login after a system reboot, that works on Server 2008?
I've tried tweaking some registry values (I don't have the link right now) and we've also tried a couple of programs (one free program didn't work, another one costs money).
Edit Since several people have asked for my reasons - I need to run Selenium web tests on a TeamCity build agent, and they don't work well when the build runs as a windows service. Running them in a user session solves the problem.
For a Windows 2008 domain member, add AutoAdminLogon as a string value (REG_SZ) with a value of 1 to the key
Next, run the User Accounts control panel by typing control userpasswords2 in the Run command.
On the Users tab, uncheck the box "Users must enter a username..." and then add the username and password to autologon with.
You may try autologon form sysinternals. It permits you to make windows logon automaticaly under a specified account with the credentials encrypted.
Helpful Tip on Windows autologin: Any Legal Notice that pops up before Windows prompts for user name and password will stop autologin. There may be a way to click passed the prompt automatically, but it was easier to just delete the annoying keys in the registry:
Open regedit, delete the string values in the two keys: * LegalNoticeCaption ** LegalNoticeText in HKLM\Software\Microsoft\WindowsNT\CurrentVersion\WinLogon
source for the registry edits: http://www.annoyances.org/exec/forum/winxp/t1107277811
In Server 2008 these same keys are also found in: HKLM\Software\Microsoft\Windows\CurrentVersion\Policy\System
Be sure to check in both locations to be certain the values have been deleted.
The legal notice issue was causing our autologin to hang. Since this was on a remote 2008 Server in the Verizon cloud it was impossible to watch the autologin after a reboot.
The sysinternals autologin tool works very well to get autologin to work. It is already referenced earlier in this post.
Have a look at http://sourceforge.net/projects/runasservice/. It's a tool to run an existing application as a service. This service should use your desired user account. This should solve your problem.
You say you need the program to run in a specific user session. Can't you just schedule a task for that program and use that user's credentials? You'll get the whole user settings: my documents, settings, etc, just as if the user was present.
Are you absolutely sure you need to do that? It's always a security risk to have a user (or administrator) logged in locally to a server. If you need to start a program or something that is not available as service, have a look at Group Policy (Active Directory) or the Local Security Policy (if not in a domain). You can define scripts that will be run after boot (or before shutdown, after login/logout, etc) without user interaction.
This should work-or at least it always has for me. I know it says for XP but it should apply: