Using unattend.xml in OOBE initialization for pre-installed Windows

Discussion in 'Windows 11' started by sacarias, Aug 18, 2024.

  1. sacarias

    sacarias MDL Member

    Nov 21, 2018
    110
    1
    10
    I already read about Windows unattended installations via autounattend.xml and unattend.xml, being the first used for WindowsPE (beginning of installation) and the second just for OOBE after initial installation.

    But by searching on internet all search results say that both are to be used in the USB media installer.

    How can I use unattend.xml for OEM pre-installed Windows?
    As soon as I power on out-of-the-box rigs Windows initiates a small "installation" process before going directly to the OOBE steps...

    Thanks.

    Oh, question is for both Win11 and Win10.
     
  2. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,419
    2,603
    120
    1. c:\windows\system32\sysprep
    2. Put on this folder unattend.xml
    3. Run sysprep in oobe mode
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Bezalel

    Bezalel MDL Senior Member

    Apr 30, 2012
    251
    28
    10
    It sounds like you need a “provisioning package”.
     
  4. Flipp3r

    Flipp3r MDL Guru

    Feb 11, 2009
    2,015
    966
    90
    Install the latest ADK. Use the included "Windows System Image Manager" to create your autounattend.xml. All installation sections are covered my the tool.
    If your installing with the autounattend.xml, windows will copy it to \windows\panther\unattend.xml folder. If you open the unattend.xml you'll see " wasPassProcessed="true">" in the relevant sections...
    ei, <settings pass="oobeSystem" wasPassProcessed="true">
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. sacarias

    sacarias MDL Member

    Nov 21, 2018
    110
    1
    10
    Are there any other locations Windows copies the unattend.xml to?
    I would like to delete them all after installation since they can be storing sensible data such as passwords...
     
  6. 12 lb Turkey

    12 lb Turkey MDL Member

    Nov 24, 2022
    120
    66
    10
    C:\Windows\Panther is the only place for the staged copy of unattend.xml.

    Windows does scrub the password fields when it's done:
    Code:
               <AutoLogon>
                   <Enabled>true</Enabled>
                   <LogonCount>9999999</LogonCount>
                   <Username>TWELVELB</Username>
                   <Password>*SENSITIVE*DATA*DELETED*</Password>
               </AutoLogon>
               <OOBE>
                   <HideEULAPage>true</HideEULAPage>
                   <HideLocalAccountScreen>true</HideLocalAccountScreen>
                   <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                   <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                   <NetworkLocation>Work</NetworkLocation>
                   <ProtectYourPC>3</ProtectYourPC>
               </OOBE>
               <UserAccounts>
                   <LocalAccounts>
                       <LocalAccount wcm:action="add">
                           <Group>Administrators</Group>
                           <Name>TWELVELB</Name>
                           <Password>*SENSITIVE*DATA*DELETED*</Password>
                       </LocalAccount>
                   </LocalAccounts>
               </UserAccounts>
           </component>
       </settings>
    
    What I would be more scared about is your answer file being read on the install media, or a network share. If you have AD, use an Unsecure Join so no private password needs to be exposed.
     
  7. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,592
    1,590
    150
    Could use a simple password and change it after also...
     
  8. sebus

    sebus MDL Guru

    Jul 23, 2008
    6,384
    2,037
    210
    He definitely does need that!
     
  9. sacarias

    sacarias MDL Member

    Nov 21, 2018
    110
    1
    10
    Do I put answer file in that Sysprep folder even when laptop is new out of box and has not been initialized? (When turning on it runs the "Preparing" black screen before entering OOBE).
    And anyway, running sysprep.exe /oobe /reboot /unattend:E:\unattend.xml didn't work; this only processed the OOBE pass and not the Specialize pass...
    Volume E was an external USB drive.

    How can I use that?
     
  10. sebus

    sebus MDL Guru

    Jul 23, 2008
    6,384
    2,037
    210
    Create yourself one with Windows Configuration Designer from Store