Really need some help - changing registry values after my task sequence is finished for auto logon RRS feed

  • Question

  • Good day all,

    I am trying to set auto logon for Windows after my task sequence is done. I am aware LTICleanup removes autologon registry entries, so I have used the Z-FinalConfig custom script ( provided on these forums as a way to launch a script AFTER the task sequence is completed.

    I've tried running regedit /s and reg import from this post task sequence script to import a registry file with the logon values defined. Although my script indicates it executes successfully, the registry values are not updated. My script works fine because if I launch it manually either from a command prompt or by double clicking, it works and the values are added. For some reason though, it does not seem to make the registry changes when launched from my task sequence.

    I thought it may be a permissions issue, but I am running as Administrator with UAC disabled. I am stumped on this and am hoping someone has done something like this before and can help. Thanks a lot.

    Friday, September 6, 2013 9:07 PM

All replies

  • Set the registry values using VBScript directly in the HTA. There are existing samples in the HTA you can "steal" from.

    / Johan

    Regards / Johan Arwidmark Twitter: @jarwidmark Blog: FB:

    Sunday, September 8, 2013 8:44 AM
  • Thanks Johan. That is what I was trying to do, but I swear I could not get it to work for the life of me. As troubleshooting, I was running reg import from the HTA and then pausing my script so I could take a look at the registry manually, and I did not see it updating the keys at all. But running reg import manually from the command line would cause an update.

    After much frustration, I replaced the HTA with a simpler VBS file. I added some logic to check for the AutoLogonCount to be set to 0. I thought maybe I was not waiting long enough for LTICleanup to finish cleaning the autologon registry keys. I was still having trouble getting this to work. Finally, I've looked at my registry keys I'm trying to write and I noticed I was not deleting the AutoLogonCount key. My understanding is if this is present, the autologon values like DefaultPassword will be deleted by Windows automatically on next reboot.

    I've since added an entry to my reg file to delete the AutoLogonCount and my values now seem to be sticking. I am still not sure why previously I was not at least seeing the registry values being updated BEFORE the reboot though, if AutoLogonCount causes them to be deleted on startup. It was like my commands were running but being ignored.

    I'm testing a few more times to make sure this is still working and then I may switch back to your HTA. Is there anything else that I need to take into account when trying to write my AutoLogon registry keys after the task sequence is finished? Thanks for your help and scripts as well!

    Sunday, September 8, 2013 1:13 PM
  • I'd like to add in case anyone else has as must frustration as I did with this, it seemed my HTA checking for TSManager to exit was not enough. I found I had to check for the AutoLogonCount key to be set to be sure LTI was done cleaning up those values. I found this out as I did 4 or 5 successful test deployments where things rebooted and autologged in fine, only to have the 6th fail and found my registry keys were missing. Hopefully, that saves someone else some frustration.
    Tuesday, September 10, 2013 5:36 PM
  • Cool, thanks for posting back the solution... Maybe I should add a routine that checks for the LTICleanup.wsf script to complete as well.

    / Johan

    Regards / Johan Arwidmark Twitter: @jarwidmark Blog: FB:

    Tuesday, September 10, 2013 8:23 PM