I have a post in the PowerShell forums (http://social.technet.microsoft.com/Forums/windowsserver/en-US/4c5d91a1-4e9f-4292-b407-145f47e21b36/stumped-at-autologin-issue?forum=winserverpowershell#1afa2d4d-8189-4caa-8904-d9c7edb88717), but I realized the issue may be a Windows Issue.
Short version - While logged on to a newly imaged Windows 7 64 bit PC with a Non Domain Local admin account, a PowerShell script is kicked off that adds the PC to the domain, asks for a UserName of the person being built for and if it is ConferenceRoom, sets the registry to login with an Account with AD rights as well as running another PS script upon logon, and then reboots.
Assuming I entered ConferenceRoom, the PC reboots, the batch script kicks off to launch the PS script. Here is where I discovered the issue:
PC Auto Logins in as SETUP
Batch script kicks off PS script which does its AD thing and then is supposed to delete the AutoAdminLogon,DefaultDoaminName,DefaultUserName, and DefaultPasswordName in HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
I actually connect to the new PC from my laptop as the registry deletions are supposed to happen and see thechanges not happen.
However. If i can cel the script and let the setup profile load completely, rerun the script, the registry settings at HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon change just fine.
The weird part is that the registry settings at HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\RunOnce gets changed each time. It sjust the settings at HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon that are not changing.
ANy registry gurus out there who can shed some light?
Matt Dillon