Custom autounattend.xml?

tired-it

Member
Messages
175
Reaction score
19
Here's another thing I've been working on for a while. Hopefully the answer is simpler than I expected. I enabled the autounattend file in NTLite and adjusted the settings how I wanted. Now, the only thing that pops up when I install Windows is the partitioning of the drive. Well... I want that automated too, but I don't have the premium version of NTLite.

So I navigated to the image cache and found the "autounattend.xml" file and opened it up in the Windows System Image Manager and added the options for wiping and partitioning a drive. Would the image in NTLite keep the extra info in the file? If I were to build the ISO, would it have the originally configured settings plus the newly added partitioning sections?

And more importantly, would that work? Can it cause boot issues?
 
WSIM is a fully-featured tool that can write custom unattended files, and is probably better at it than NTLite's Unattended mode. After all, MS wrote it and they also know all the undocumented config settings. The only thing WSIM can't do is NTLite's dynamic host rename, which is just a tiny VBS script that NTLite injects to the image.

If you know WSIM, just copy their unattend.xml to the ISO distribution folder and not bother using NTLite's Unattended. The only thing you would have to check is the InstallFrom value for /IMAGE/INDEX.

I happen to know the XML syntax, so I will copy autounttend.xml from another ISO folder and edit it to do things NTLite currently doesn't support. But the licensed Unattended features are helpful for non-technical users.
 
WSIM is a fully-featured tool that can write custom unattended files, and is probably better at it than NTLite's Unattended mode. After all, MS wrote it and they also know all the undocumented config settings. The only thing WSIM can't do is NTLite's dynamic host rename, which is just a tiny VBS script that NTLite injects to the image.

If you know WSIM, just copy their unattend.xml to the ISO distribution folder and not bother using NTLite's Unattended. The only thing you would have to check is the InstallFrom value for /IMAGE/INDEX.

I happen to know the XML syntax, so I will copy autounttend.xml from another ISO folder and edit it to do things NTLite currently doesn't support. But the licensed Unattended features are helpful for non-technical users.
Interesting, that makes sense. Unfortunately, I'm not well versed with WSIM. I was able to follow a guide to manually add partitioning information to it. I basically copied that section from the XML file and added it to the one in the NTLite cache. I assume that won't be enough would it?

For my InstallFrom value, this is what I have
Code:
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/INDEX</Key>
<Value>1</Value>
</MetaData>
</InstallFrom>

Note, this is the autounattend.xml file. I understand autounattend and unattend are technically two different things? Should I stick to just unattend in this case?
 
Answer files is the generic name for all unattend.xml files.

When installed to the ISO's root folder, it's renamed autounattend.xml and applies to all images. But it's unattend.xml if found in other ISO or distribution share folders. There is a long search order that Setup follows to know which answer file applies in different scenarios.

For normal imaging, copy this file as autounattend.xml to the ISO root folder. Don't copy the file anywhere else or it doesn't work.

The image index corresponds to your WIM's list of included image. For a single edition WIM, it's trivially index 1. When this value is empty, Setup will prompt you at install time to pick an image.
 
Answer files is the generic name for all unattend.xml files.

When installed to the ISO's root folder, it's renamed autounattend.xml and applies to all images. But it's unattend.xml if found in other ISO or distribution share folders. There is a long search order that Setup follows to know which answer file applies in different scenarios.

For normal imaging, copy this file as autounattend.xml to the ISO root folder. Don't copy the file anywhere else or it doesn't work.

The image index corresponds to your WIM's list of included image. For a single edition WIM, it's trivially index 1. When this value is empty, Setup will prompt you at install time to pick an image.
That makes sense, it matches what I've been reading too. Looks like the ISO booted from a flash drive just fine and successfully completed the installation. Unfortunately, the auto-partitioning did not seem to work. Ah well, I'll keep looking there.
 
That makes sense, it matches what I've been reading too. Looks like the ISO booted from a flash drive just fine and successfully completed the installation. Unfortunately, the auto-partitioning did not seem to work. Ah well, I'll keep looking there.
I do have the paid license and I certainly use the feature you are trying to get working. It's definitely quite easy to do with NTLite. I spend $40/Week on coffee, so it's a no-brainer for me I suppose.
 
WSIM is a fully-featured tool that can write custom unattended files, and is probably better at it than NTLite's Unattended mode. After all, MS wrote it and they also know all the undocumented config settings. The only thing WSIM can't do is NTLite's dynamic host rename, which is just a tiny VBS script that NTLite injects to the image.

If you know WSIM, just copy their unattend.xml to the ISO distribution folder and not bother using NTLite's Unattended. The only thing you would have to check is the InstallFrom value for /IMAGE/INDEX.

I happen to know the XML syntax, so I will copy autounttend.xml from another ISO folder and edit it to do things NTLite currently doesn't support. But the licensed Unattended features are helpful for non-technical users.
i need to make 4 boot sticks for 4 different naming conventions. i set up one iso/usb boot stick in NTLite for the naming convention BKF-%SERIAL%. I want to just be able to edit the unattend.xml file to change the name in 3 other iso/usb boot sticks to BFL-%SERIAL%, BKI-%SERIAL% and no auto naming. i edited the autounattend.xml and the auto-saved xml files and changed BKF to BKL. The computer still was named BKF-%SERIAL%. Am I missing something here? where is that vbs script for autonaming the computer? what do I need to do to make this work? or do i have to process new ISO files to make new usb boot stick for each naming convention?
Thanks
 
Last edited:
[Prompt] or %SERIAL% in the Computer Name is a NTLite-specific enhancement, and not native to the unattended file.

When you apply this change, NTLite creates a custom VBS script to update the hostname during specialize pass. Normally to have this work on other images, you will need to reload them, and re-apply Unattended mode with the Computer Name changes.

If you're familiar with making your own unattended file, this can be substituted by a PowerShell command from the specialize pass.
Code:
    <settings pass="specialize">
        <component name="Microsoft-Windows-Deployment" 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">
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <Path>powershell -C Rename-Computer ('BKL-' + (Get-WmiObject win32_bios).SerialNumber)</Path>
                </RunSynchronousCommand>
            </RunSynchronous>
        </component>
    </settings>
 
[Prompt] or %SERIAL% in the Computer Name is a NTLite-specific enhancement, and not native to the unattended file.

When you apply this change, NTLite creates a custom VBS script to update the hostname during specialize pass. Normally to have this work on other images, you will need to reload them, and re-apply Unattended mode with the Computer Name changes.

If you're familiar with making your own unattended file, this can be substituted by a PowerShell command from the specialize pass.
Code:
    <settings pass="specialize">
        <component name="Microsoft-Windows-Deployment" 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">
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <Path>powershell -C Rename-Computer ('BKL-' + (Get-WmiObject win32_bios).SerialNumber)</Path>
                </RunSynchronousCommand>
            </RunSynchronous>
        </component>
    </settings>
so where is this name change vbs file or snippet?
 
"\Windows\Setup\Scripts\NTLCompName.vbs" inside of the install image. Since the script's not running interactively (unlike [Prompt] for hostname), then it's easy to have the autounattended file do this task since you have 4 different USB drives.

The autounattend file.xml can be edited without loading, or opening the WIM file, since the rename command is a PS one-liner.
 
Back
Top