How to launch a background Windows user after Sysprep?

Otor Dupont 1 Reputation point
2021-10-17T18:16:16.063+00:00

Hello ! I want to make Windows Images that can be clonable, so I'm currently using Sysprep with OOBE. Right now, I would like (when the windows machine boot) to launch a background user that will have an open session and dedicated tasks to do.

I was previously using WinLogon but Sysprep actually wipes those registries. I'm currently looking into Answer Files to make the user persists and login it. The problem is that I have my user but the AutoLogon attribute seems to not work (or not the way I wanted).

Do you know a way yo get a background user launched after SysPrep? Either via AnswerFiles, a way to keep winlogon registry or other mecanisms?

Thank you very much!

This is currently my answer file OOBE component:

<settings pass="oobeSystem">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
      <UserAccounts> 
          <LocalAccounts>
            <LocalAccount wcm:action="add">
              <Password>
                <Value>'+$pswStr+'</Value>
                <PlainText>true</PlainText>
              </Password>
              <Description>'+$usrname+'</Description>
                <DisplayName>'+$usrname+'</DisplayName>
                <Group>Administrators;Users</Group>
                <Name>'+$usrname+'</Name>
            </LocalAccount>
          </LocalAccounts>
        <AdministratorPassword>
          <PlainText>true</PlainText>
          <Value>'+$pswStr+'</Value>
        </AdministratorPassword>
      </UserAccounts>
      <AutoLogon>
        <Password>
          <Value>'+$pswStr+'</Value>
          <PlainText>true</PlainText>
        </Password>
        <LogonCount>9999</LogonCount>
        <Enabled>true</Enabled>
        <Username>'+$usrname+'</Username>
      </AutoLogon>
      <OOBE>
        <HideEULAPage>true</HideEULAPage>
        <NetworkLocation>Work</NetworkLocation>
        <ProtectYourPC>1</ProtectYourPC>
        <SkipMachineOOBE>true</SkipMachineOOBE>
        <SkipUserOOBE>true</SkipUserOOBE>
      </OOBE>
    </component>
  </settings>

Also here is what I was using for WinLogon registries values:

New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name AutoAdminLogon -Value 1 | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefaultUserName -Value $usrname | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name DefaultPassword -Value $pswStr | Out-Null

Windows Server Setup
Windows Server Setup
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
241 questions
0 comments No comments
{count} votes