none
Keep Autologon after LiteTouch finishes

    Question

  • Hi all,

    I got a W2k8R2 Server doing WDS by MDT.
    I also have several tasksequences which install XP SP3 with different settings.
    On one TS I want to keep autologon after the LTI has finished.

    Therefore, I got my unattended.txt to read this
        AutoLogon="Yes"   
        AutoLogonCount=999 

    And an application installing a reg-file reading this
    [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]
    "AutoLogonCount"=-
    "DefaultUsername"="Administrator"
    "DefaultPassword"="************"
    "DefaultDomainName"="."
    "AutoAdminLogon"="1"
    [and many more entries for different keys]

    At the end of my LTI, the computer reboots and I'm asked to log on. After doing so, I can see that my keys are created, except my autologon keys. If I reapply the reg file, the values get entered and autologon works just fine. I also move the Application to the very end of the TS without success.

    How can I make a single TS to not delete the autologon settings at the end?

    Friday, August 06, 2010 8:37 AM

All replies

  • AdreasAU,

    Most would suggest that you do not configure your devices to autologin as the administrator..

    If you want MDT to not break the autologin after the build is complete, you'll have to modify the "LTICleanup.wsf" script in your "Scripts" folder in your Deployment Share.

    Comment out the following code and it should do the trick.

    '//----------------------------------------------------------------------------
      '//  Clear the autologon registry keys
      '//----------------------------------------------------------------------------

      oLogging.CreateEntry "Removing AutoAdminLogon registry entries", LogTypeInfo

      On Error Resume Next
      oShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon", "0", "REG_SZ"
      oShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName", "", "REG_SZ"
      oShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName", "", "REG_SZ"
      oShell.RegDelete "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword"
      oShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoLogonCount", &H00000000, "REG_DWORD"
      On Error Goto 0

    • Proposed as answer by XxX sdk XxX Friday, August 06, 2010 6:40 PM
    Friday, August 06, 2010 6:09 PM
  • I mainly agree with the point that you shouldnt autologon an administrator, but we have some machines which have to do so.

    editing the script is the way i chose meanwhile which also means, i have to apply a reg file for all other tasksequences.
    Is this really the 'real solution'?

    Monday, August 09, 2010 8:17 AM
  • The autologon is disabled as part of the routine LTICleanup it runs at the end of a TS.. (Also cleans up MININT, Sysprep folders etc).  Not sure if there is any 'real' solution since this isn't typical process..

    Monday, August 09, 2010 3:36 PM
  • I had a need for this capability on a consulting project and didn't want to alter MDT core script code so I created the following autoit script:=

    AUTOIT Code:

    ;Setting the common processes that MDT runs while performing an LTI.  If these processes are
    ;running so is MDT
    $PID = ProcessExists("TSProgressUI.exe") ; Will return the PID or 0 if the process isn't found.
    $PID2 = ProcessExists("mshta.exe"); Will return the PID or 0 if the process isn't found.
    $PID3 = ProcessExists("cscript.exe"); Will return the PID or 0 if the process isn't found.

    ;Create a while loop
    $loop = 0

    While $loop = 0
       ;Check to see if any of those MDT procces Exist. If they do sleep for 250milliseconds and check again
       If (($PID <> 0) OR ($PID2 <> 0) OR ($PID3 <> 0)) Then
          sleep(250)
       $PID = ProcessExists("TSProgressUI.exe") ; Will return the PID or 0 if the process isn't found.
       $PID2 = ProcessExists("mshta.exe"); Will return the PID or 0 if the process isn't found.
       $PID3 = ProcessExists("cscript.exe"); Will return the PID or 0 if the process isn't found.
       Else
       ;When the processes no longer exists it must mean that MDT is finished. Time to do our stuff
       ;Wait for 5 seconds just to make sure MDT is finished cleaning up.  You can probably remove this line
       MsgBox(0, "Please wait setting post MDT Tasks", "Please wait setting post MDT Tasks", 5)
       ;Run the Post Imaging Task
       Run(@scriptdir & "\install.bat")
       $loop = 1
       EndIf
    WEnd

    You can download the autoit code, more detailed instructions and compiled script at:

    MDTFinishScript.zip
    https://panaconsulting.egnyte.com/h-s/20130329/d34ce06f093f4e04

    This can also be used for other post tasks that need to take place after MDT cleanup.


    • Edited by SABK Friday, March 29, 2013 9:51 PM mistake
    • Proposed as answer by SABK Friday, March 29, 2013 10:34 PM
    Friday, March 29, 2013 9:45 PM