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.

1
  • What is the reason for wanting this? Perhaps it can be resolved by doing whatever needs doing as a service or a scheduled task? Oct 12, 2009 at 10:31

7 Answers 7

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.

3
  • 2
    It is not until you give up on the last step (where do I type in the user name and password, oh I give up and press ok), that you are prompted for the user name and password. Feb 23, 2012 at 14:30
  • 4
    Must check and uncheck users must enter a user name and password ..., then press ok. Feb 23, 2012 at 16:01
  • How can this be used to login multiple users?
    – LifeH2O
    Mar 31, 2016 at 9:59
8

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

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.

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.

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.

4
  • 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, 2009 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, 2009 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, 2009 at 7: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, 2009 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.

2
  • 1
    I need a program to run in a specific user session. I don't really care about security, it's in the company intranet.
    – ripper234
    Oct 12, 2009 at 11:03
  • I am running in virtual-box. Feb 23, 2012 at 14:33
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .