Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use Windows Server 2008.

I am looking for a way to automatically start a user session when I power on my workstation.

Scenario: 1) I deploy a remote virtual machine with Windows Server 2008; 2) I configure Logon script on this VM to run some processes; 3) I need to start a user session automatically when I power on this VM to run the the automatic tests there. Note, I can't run the tests under the System. I need a user session with Desktop because I use TestComplete tests to make GUI testing.

Does anybody have an idea how to do this ? I have already tried automatic Windows Logon functionality but seems it doesn't help anyway. When I restart my VM - it doesn't start user's session automatically.

Thank you!

share|improve this question

migrated from May 15 '11 at 6:23

This question came from our site for professional and enthusiast programmers.

Setting DefaultUsername and DefaultPassword values in conjunction with AutoAdminLogon does work with Windows Server 2008. Where exactly did you have problems with this process?

share|improve this answer

Try to import the following registry data (first save as "AutoLogon.reg", then right-click -> merge):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoLogonChecked]


Now restart your machine, and check if that user logged in (task manager -> users) from another user session.

EDIT : If you're getting black screenshots or other GUI problems (when using Selenium, Test Complete, etc.), then create a batch file that disconnects Remote Desktop, instead of closing the RDP session with the regular X button:

%windir%\system32\tscon.exe %SESSIONNAME% /dest:console
share|improve this answer

For the graphical user fans under us, see this tutorial:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.