4

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!

migrated from stackoverflow.com May 15 '11 at 6:23

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

3

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

2

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]
"DefaultDomainName"="YOUR_DOMAIN"
"DefaultUserName"="YOUR_USER"
"DefaultPassword"="YOUR_PASSWORD"
"ForceAutoLogon"="1"
"AutoAdminLogon"="1"
"LegalNoticeCaption"=""
"LegalNoticeText"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoLogonChecked]
@="1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system]
"LegalNoticeCaption"=""
"LegalNoticeText"=""

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
0

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

http://www.itsupportguides.com/windows-7/windows-7-auto-logon-with-domain-computer/

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.