June 9, 2017 fiducheah

I need my task sequence to autologon after the task sequence ends in order to launch an interactive application install that can only succeed when the user is logged in.  Sounds simple enough, but this has been discussed in a variety of ways, with many solutions being circulated in the form of complex scripts but ultimately none works.

Finally stumbled upon Simon Dettling’s post that nailed the issue and offered a workable solution:

Windows 7 Autologon only works after second application

Problem:  Despite multiple attempts to hard code the registry (WINLOGON) for autologon in the Task Sequence, SCCM/MDT would reset AUTOADMINLOGON to 0 and delete the DefaultPassword value



Create 6 tasks to accomplish this:


2017-06-08 17_03_45-Autologon Task Sequence Editor

Setting of Registry is done with Command Line, I prefer the password be kept here than in a PowerShell script or batch file.  My application install will actually purge the registry of username and password after the fact.

Run Command Lines:

Create one for every entry below:

2017-06-08 17_04_16-Autologon Task Sequence Editor

reg delete “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” /v “AutoLogonCount” /f  <– If you don’t delete this you will not be able to achieve autologon

reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” /v “AutoAdminLogon” /t REG_SZ /d 1 /f

reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” /v “AutoLogonCount” /t REG_SZ /d 2 /f  <– I only need to autologon twice

reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” /v “DefaultPassword” /t REG_SZ /d “xxxxxxxx” /f

eg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” /v “DefaultUserName” /t REG_SZ /d “xxxxx” /f

reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” /v “DefaultDomainName” /t REG_SZ /d “xxxxx” /f


Reboot after Task Sequence:

Use the Task Sequence Variable SSMSTSPostAction to achieve this

cmd.exe /c shutdown /r /t 0

2017-06-08 17_04_47-Autologon Task Sequence Editor

Leave a Reply

Your email address will not be published. Required fields are marked *