13

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.

ripper234
  • 5,710
  • 9
  • 40
  • 49
  • What is the reason for wanting this? Perhaps it can be resolved by doing whatever needs doing as a service or a scheduled task? – Oskar Duveborn Oct 12 '09 at 10:31

7 Answers7

16

For a Windows 2008 domain member, add AutoAdminLogon as a string value (REG_SZ) with a value of 1 to the key

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

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.

Doug Luxem
  • 9,592
  • 7
  • 49
  • 80
8

You may try autologon form sysinternals. It permits you to make windows logon automaticaly under a specified account with the credentials encrypted.

Maxwell
  • 5,026
  • 1
  • 25
  • 31
3

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.

Chris
  • 31
  • 2
2

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.

Scoregraphic
  • 524
  • 6
  • 9
1

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.

Knox
  • 2,453
  • 2
  • 26
  • 33
  • I don't want to schedule it, I want to raise the entire build agent process (that should run always) when the machine starts. – ripper234 Oct 12 '09 at 12:11
  • Schedule task for Windows 2003 allows you to schedule a task to run at system startup. I'm sure 2008 has that choice as well. – Knox Oct 12 '09 at 18:22
  • Still, I want a proper session, the user credentials are not enough. When I tried running it as a service (under the same user credentials), it didn't work. – ripper234 Oct 13 '09 at 07:45
  • Running as a service is not the same as running as a scheduled task. I really believe that an exe running under a scheduled task is a proper session. The only thing I'm not sure about is if the process insisted on displaying stuff on a real CRT. Since I've done this with vanilla apps, their display stuff goes into the bit bucket. Give it a shot; it's such a cleaner solution than some of the other suggested. – Knox Oct 13 '09 at 10:21
0

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.

PEra
  • 2,825
  • 17
  • 14
0

This should work-or at least it always has for me. I know it says for XP but it should apply:

Josh Budde
  • 2,378
  • 14
  • 7