none
AutoLogon ONLY on first boot RRS feed

  • Question

  • Hello,

    I created a custom Windows 10 Pro image using sysprep and an unattend.xml. Deployment is simply done with USB flash devices, nothing special, because we are talking about ~5 installs per week. There is one thing left that i would want to have to improve my workflow: Make an automatic logon after the windows 10 installation is finished. Currently i start the windows 10 installation, and do other tasks in the meantime. After a few minutes i come back and the sign-in screen greets me where i login with the admin account and password i specified in the unattend.xml. BUT that takes 1-2 minutes, its not enough time for me to do another task, but enough that it feels like a waste of time staring at the monitor for 2 minutes...

    I googled and found out about <AutoLogon>, but as far as I know its for logging in every single time the pc starts. There is a LogonCount, but it resets everytime the pc reboots. After much time spent in threads talking about <AutoLogon>, without success, i decided to make my own.

    What i have tried so far is including this in my unattend.xml:

    <AutoLogon>
       <Password>
          <Value>Qwertz0815</Value>
       </Password>
       <Enabled>true</Enabled>
       <LogonCount>1</LogonCount>
       <Username>Admin</Username>
    </AutoLogon>

    But it would login automaticly every time, which i definetly dont want.

    then i tried to make these registry changes:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
    "DefaultUserName"="Admin"
    "DefaultPassword"="Qwertz0815"
    "AutoAdminLogon"="1"
    "ForceAutoLogon"="1"
    "AutoLogonCount"="1"

    But after running sysprep and trying to install it on a pc it got stuck in the windows installation forever.

    I hope there is a way to make it only login automatically on the very first boot.

    This is my current unattend.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="oobeSystem">
            <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <SystemLocale>de-DE</SystemLocale>
                <UILanguage>de-DE</UILanguage>
                <UserLocale>de-DE</UserLocale>
                <InputLocale>0407:00000407</InputLocale>
            </component>
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <OOBE>
                    <HideEULAPage>true</HideEULAPage>
                    <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
                    <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                    <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                    <UnattendEnableRetailDemo>false</UnattendEnableRetailDemo>
                    <ProtectYourPC>3</ProtectYourPC>
                </OOBE>
                <UserAccounts>
                    <LocalAccounts>
                        <LocalAccount wcm:action="add">
                            <Password>
                                <Value>UQB3AGUAcgB0AHoAMAA4ADEANQBQAGEAcwBzAHcAbwByAGQA</Value>
                                <PlainText>false</PlainText>
                            </Password>
                            <Description>Admin</Description>
                            <DisplayName>Admin</DisplayName>
                            <Group>Administrators</Group>
                            <Name>Admin</Name>
                        </LocalAccount>
                    </LocalAccounts>
                </UserAccounts>
    	    <FirstLogonCommands>
                    <SynchronousCommand wcm:action="add">
                        <Order>1</Order>
    		    <Description>making the magic happen</Description>
                        <CommandLine>cmd /C wmic useraccount where "name='Admin'" set PasswordExpires=FALSE</CommandLine>
                    </SynchronousCommand>
                </FirstLogonCommands>
                <RegisteredOrganization>CENSORED</RegisteredOrganization>
                <TimeZone>W. Europe Standard Time</TimeZone>
            </component>
        </settings>
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <OEMInformation>
                    <Logo>C:\Windows\System32\oemlogo.bmp</Logo>
                    <Manufacturer>CENSORED</Manufacturer>
                    <SupportHours>CENSORED</SupportHours>
                    <SupportPhone>CENSORED</SupportPhone>
                    <SupportURL>CENSORED</SupportURL>
                </OEMInformation>
                <CopyProfile>false</CopyProfile>
                <OEMName>CENSORED</OEMName>
                <RegisteredOrganization>CENSORED</RegisteredOrganization>
                <TimeZone>W. Europe Standard Time</TimeZone>
            </component>
        </settings>
        <cpi:offlineImage cpi:source="wim:c:/iso_files/sources/install.wim#Windows 10 Pro" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>
    

    Any help at all is very much appreciated.

    Monday, September 2, 2019 10:11 AM

Answers

  • The very first boot / autologon would be after Pass 4 going into Pass7. This might not be what you want to do. So set the autologoncount to 2 if you want it to autologon one time after Pass7 has run. Or you could just disable autologon via the registry when you are finished.

    Sean Liming - Book Author: Starter Guide Windows 10 IoT Enterprise - www.annabooks.com / www.seanliming.com

    • Marked as answer by milenkovic Thursday, September 5, 2019 7:40 AM
    Tuesday, September 3, 2019 4:15 PM
    Moderator

All replies

  • The problem is the AutoLogonCount value is set too low.  The autologoncount is a count down. After each login the count is decremented by 1. Once the count hits 0 autologon is off. Set the value to 4294967294, or you could also delete the autologoncount registry key.


    Sean Liming - Book Author: Starter Guide Windows 10 IoT Enterprise - www.annabooks.com / www.seanliming.com

    Monday, September 2, 2019 3:04 PM
    Moderator
  • But I only want autologon to work once. If i increase the value, wont it logon multiple times automaticly?
    Tuesday, September 3, 2019 11:06 AM
  • The very first boot / autologon would be after Pass 4 going into Pass7. This might not be what you want to do. So set the autologoncount to 2 if you want it to autologon one time after Pass7 has run. Or you could just disable autologon via the registry when you are finished.

    Sean Liming - Book Author: Starter Guide Windows 10 IoT Enterprise - www.annabooks.com / www.seanliming.com

    • Marked as answer by milenkovic Thursday, September 5, 2019 7:40 AM
    Tuesday, September 3, 2019 4:15 PM
    Moderator
  • Thank you! Setting the autologoncount to 2 is what i ended up doing.
    Thursday, September 5, 2019 7:40 AM
  • Great. Good luck.

    Sean Liming - Book Author: Starter Guide Windows 10 IoT Enterprise - www.annabooks.com / www.seanliming.com

    Thursday, September 5, 2019 6:11 PM
    Moderator