I know this has been already answered else where... but could someone help me in my scripted install of Windows 7 (32-Bit) Auto-login of local workgroup account.

Delete the setup account.

Local administrator account enabled

and the auto-login account enabled with, password, password doesn't expire, and user cannot change password.

Here is what I currently have:

start /wait net user administrator /active:yes
start /wait net user administrator password
start /wait net user SSCC password /add /fullname:"SSCC" /expires:never /passwordchg:no /active
start /wait wmic useraccount where Name='SSCC' set PasswordExpires=False
start /wait net user SSCC /active:yes
start /wait net localgroup groupname SSCC /add
start /wait net user kaceadmin /delete
del /Q /F C:\Users\kaceadmin
start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoAdminLogon /d 1 /f
start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultUserName /d SSCC /f
start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultPassWord /d sscc /f
start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v ForceAutoLogon /d 1 /f

I have it working well on Windows 7 (64-Bit) with a couple extra reg keys that are required for 64-Bit.

 


 

Answer Summary:
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

1

only thing I see is that you are setting user SSCC's password to password not sscc

start /wait net user SSCC password /add /fullname:"SSCC" /expires:never /passwordchg:no /active

should be

start /wait net user SSCC sscc /add /fullname:"SSCC" /expires:never /passwordchg:no /active

Answered 02/20/2013 by: SMal.tmcc
Red Belt

  • That's the command I have... I just removed the admin and Sscc passwords from the script and replaced with password.
    • I will test in my lab, it should work as you have it.
  • If you remember, I had the same problem with x64... I have setup the x86 the same, minus the commands required for 64bit. I have setup my post install tasks the same and all too.
    • The one thought I am looking at, you are deleting your logged in user mid script, my delete user command is one of the last things I do, I am running your script on a test deployment. The only difference I am doing is not deleting the local user account.
  • Ok ran test with this script and it logs in auto. Try moving these to the end of your batch
    start /wait net user kaceadmin /delete
    del /Q /F C:\Users\kaceadmin
    you may also want to look at rmdir instead of del

    :::::::::::::::Start of script::::::::::

    net start w32time

    start /wait %SystemRoot%\system32\w32tm /config /update /manualpeerlist:ntp.tmcc.edu /syncfromflags:manual

    Start /wait net user administrator xxxxxxxxxxxxx
    Start /wait net user dfault xxxxxxxxxxxx

    start /wait cscript %SystemRoot%\System32\slmgr.vbs -ATO

    start /wait net user SSCC SScc123$ /add /fullname:"SSCC" /expires:never /passwordchg:no /active

    start /wait wmic useraccount where Name='SSCC' set PasswordExpires=False

    start /wait net user SSCC /active:yes

    start /wait net localgroup administrators SSCC /add

    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoAdminLogon /d 1 /f

    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultUserName /d SSCC /f

    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultPassWord /d SScc123$ /f

    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v ForceAutoLogon /d 1 /f

    reg.exe DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /f
  • OK, great! I will look into this. However, I will be out of the office, so I will do this when I return. Thank you for your help.
  • This content is currently hidden from public view.
    Reason: Removed by member request
    For more information, visit our FAQ's.
  • Look in the registry under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon is there still a DefaultDomainName key? I am able to duplicate this on a test machine, that key is still there after removing the machine from the domain when I had autologon set before removing it. If that is the case you can add a reg /delete line to your script to nuke that key.
  • OK, here is what I have in the script... it is still not working.. So, I removed all the post install tasks except the autologin script. Still a no go.

    start /wait net user administrator /active:yes
    start /wait net user administrator gr1zzly
    start /wait net user SSCC sscc /add /fullname:"SSCC" /expires:never /passwordchg:no /active
    start /wait wmic useraccount where Name='SSCC' set PasswordExpires=False
    start /wait net user SSCC /active:yes
    start /wait net localgroup groupname SSCC /add
    start /wait reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /d 0 /T REG_DWORD /f
    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoAdminLogon /d 1 /f
    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultUserName /d SSCC /f
    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultPassWord /d sscc /f
    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v ForceAutoLogon /d 1 /f
    start /wait cscript C:\Windows\System32\slmgr.vbs -skms 10.1.1.53:1688
    start /wait cscript C:\Windows\System32\slmgr.vbs -ipk XXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXX
    "C:\Program Files\Common Files\microsoft shared\OfficeSoftwareProtectionPlatform\ospprearm.exe"
    start /wait cscript %SystemRoot%\System32\slmgr.vbs -ATO
    start /wait cscript "c:\program files\microsoft office\office14\ospp.vbs" /act
    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v ipv6kill /d
    start /wait reg.exe add "HKLM\SYSTEM\CurrentControlSet\services\Tcpip6\Parameters\" /v DisabledComponents /t REG_DWORD /d 4294967295 /f
    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v kclean /d "c:\kcleanup.exe"
    start /wait net user kaceadmin /delete
    rmdir C:\Users\kaceadmin
    Reply
  • Sorry got in a hurry.
    • no prob, let me know about the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\DefaultDomainName key
  • This was a scripted install never on a workgroup, however the key exists. Doing some more test tomorrow. Didn't have much time today.
  • So after testing again today... the following script is what I have and some reg keys are in place others are not...

    start /wait net user administrator /active:yes
    start /wait net user administrator password
    start /wait net localgroup administrators administrator /add
    start /wait net localgroup "remote desktop users" administrator /add
    start /wait net user SSCC sscc /add /fullname:"SSCC" /expires:never /passwordchg:no /active
    start /wait wmic useraccount where Name='SSCC' set PasswordExpires=False
    start /wait net user SSCC /active:yes
    start /wait net localgroup groupname SSCC /add
    start /wait reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /d 0 /T REG_DWORD /f
    netsh firewall set service type=FILEANDPRINT mode=ENABLE
    netsh firewall set service type=REMOTEDESKTOP mode=ENABLE
    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoAdminLogon /d 1 /f
    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultUserName /d SSCC /f
    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultPassWord /d sscc /f
    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v ForceAutoLogon /d 1 /f
    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v ipv6kill /d
    start /wait reg.exe add "HKLM\SYSTEM\CurrentControlSet\services\Tcpip6\Parameters\" /v DisabledComponents /t REG_DWORD /d 4294967295 /f
    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v kclean /d "c:\kcleanup.exe"
    start /wait net user kaceadmin /delete
    rmdir /S /Q C:\Users\kaceadmin



    The keys that are missing or not configured correctly are:

    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoAdminLogon /d 1 /f

    Still set to 0

    start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultPassWord /d sscc /f

    Missing completely



    When I manually add these and execute it works perfectly. Weird!
    • No not to weird, Those keys will change to that exact state when the AutoLogonCount key reaches zero.
      Lets add:
      start /wait reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultDomainName /f
      start /wait reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoLogonCount /f

      after your netsh commands.

      and remove
      start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v ForceAutoLogon /d 1 /f
  • That got it! You're such a great help! Thank you so much!
    • Good thing I am not a doctor, by the time the problem was diagnosed the patient would have died.
    • did those netsh lines solve your firewall problem?
      • Yes, I used. Tested and working well.

        netsh firewall set service type=FILEANDPRINT mode=ENABLE
        netsh firewall set service type=REMOTEDESKTOP mode=ENABLE
Please log in to comment

Answers

Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share