- Answer files (unattend.xml)
- Windows settings overview
- Answer file settings
- Create and modify an answer file
- Step 1: Create a catalog file
- Step 2: Create an answer file
- Step 3: Add new answer file settings
- Add the answer file and script to the image
- Step 6: Mount an image and add the answer file
- «Windows could not parse or process the unattend answer file for pass [specialize]» error message when you perform an in-place upgrade
- Symptoms
- Cause
- More information
- Создание специализированного файла ответов ОС Create OS specialization answer file
- Скачивание функции New-ShieldingDataAnswerFile Downloading the New-ShieldingDataAnswerFile function
- Базовый файл ответов Windows Basic Windows answer file
- Файл ответов Windows с присоединением к домену Windows answer file with domain join
- Файл ответов Windows со статическими IPv4-адресами Windows answer file with static IPv4 addresses
- Файл ответов Windows с пользовательским языковым стандартом Windows answer file with a custom locale
- Основной файл ответов Linux Basic Linux answer file
Answer files (unattend.xml)
Answer files (or Unattend files) can be used to modify Windows settings in your images during Setup. You can also create settings that trigger scripts in your images that run after the first user creates their account and picks their default language.
Windows Setup will automatically search for answer files in certain locations, or you can specify an unattend file to use by using the /unattend: option when running Windows Setup (setup.exe).
Windows settings overview
While you can set many Windows settings in audit mode, some settings can only be set by using an answer file or Windows Configuration Designer, such as adding manufacturer’s support information. A full list of answer file settings (also known as Unattend settings) is in the Unattended Windows Setup Reference.
Enterprises can control other settings by using Group Policy. For more info, see Group Policy.
Answer file settings
You can specify which configuration pass to add new settings:
1 windowsPE: These settings are used by the Windows Setup installation program. If you’re modifying existing images, you can usually ignore these settings.
4 specialize: Most settings should be added here. These settings are triggered both at the beginning of audit mode and at the beginning of OOBE. If you need to make multiple updates or test settings, generalize the device again and add another batch of settings in the Specialize Configuration pass.
6 auditUser: Runs as soon as you start audit mode.
This is a great time to run a system test script — we’ll add Microsoft-Windows-Deployment\RunAsynchronousCommand as our example. To learn more, see Add a Custom Script to Windows Setup.
7 oobeSystem: Use sparingly. Most of these settings run after the user completes OOBE. The exception is the Microsoft-Windows-Deployment\Reseal\Mode = Audit setting, which we’ll use to bypass OOBE and boot the PC into audit mode.
If your script relies on knowing which language the user selects during OOBE, you’d add it to the oobeSystem pass.
These settings could be lost if the user resets their PC with the built-in recovery tools. To see how to make sure these settings stay on the device during a reset, see Sample scripts: Keeping Windows settings through a recovery.
Create and modify an answer file
Step 1: Create a catalog file
Start Windows System Image Manager.
Click File > Select Windows Image.
In Select a Windows Image, browse to and select the image file (D:\install.wim). Next, select an edition of Windows, for example, WindowsВ 10 Pro, and click OK. Click Yes to create the catalog file. Windows SIM creates the file based on the image file, and saves it to the same folder as the image file. This process can take several minutes.
The catalog file appears in the Windows Image pane. WindowsВ SIM lists the configurable components and packages in that image.
Troubleshooting: If Windows SIM does not create the catalog file, try the following steps:
To create a catalog file for either 32-bit or ARM-based devices, use a 32-bit device.
Make sure the Windows base-image file (\Sources\Install.wim) is in a folder that has read-write privileges, such as a USB flash drive or on your hard drive.
Step 2: Create an answer file
Click File > New Answer File.
The new answer file appears in the Answer File pane.
NoteВ В If you open an existing answer file, you might be prompted to associate the answer file with the image. Click Yes.
Step 3: Add new answer file settings
In the Windows Image pane, expand Components, right-click amd64_Microsoft-Windows-Shell-Setup_(version), and then select Add Setting to Pass 4 specialize.
In the Answer File pane, select Components\4 specialize\amd64_Microsoft-Windows-Shell-Setup_neutral\OEMInformation.
In the OEMInformation Properties pane, in the Settings section, select:
- Manufacturer= Fabrikam
- Model= Notebook Model 1
- Logo= C:\Fabrikam\Fabrikam.bmp
Create a 32-bit color with a maximum size of 120×120 pixels, save it as D:\AnswerFiles\Fabrikam.bmp file on your local PC, or use the sample from the USB-B key: D:\ConfigSet\$OEM$\$$\System32\OEM\Fabrikam.bmp .
We’ll copy the logo into the Windows image in a few steps.
Set the device to automatically boot to audit mode:
In the Windows Image pane, expand Components, right-click amd64_Microsoft-Windows-Deployment_(version), and then select Add Setting to Pass 7 oobeSystem.
In the Answer File pane, select Components\7 oobeSystem\amd64_Microsoft-Windows-Deployment_neutral\Reseal.
In the Reseal Properties pane, in the Settings section, select Mode= Audit .
Prepare a script to run after Audit mode begins.
In the Windows Image pane, right-click amd64_ Microsoft-Windows-Deployment_(version) and then click Add Setting to Pass 6 auditUser.
In the Answer File pane, expand Components\6 auditUser\amd64_Microsoft-Windows-Deployment_neutral\RunAsynchronous. Right-click RunAsynchronousCommand Properties and click Insert New AsynchronousCommand.
In the AsynchronousCommand Properties pane, in the Settings section, add the following values:
Description = Sample command to run a system diagnostic check.
Order = 1 (Determines the order that commands are run, starting with 1.)
Add a registry key. In this example, we add keys for the OEM Windows Store program. Use the same process as adding a script, using CMD /c REG ADD .
For Windows 10 Customer Systems, you may use the OEM Store ID alone or in combination with a Store Content Modifier (SCM) to identify an OEM brand for the OEM Store. By adding a SCM, you can target Customer Systems at a more granular level. For example, you may choose to target commercial devices separately from consumer devices by inserting unique SCMs for consumer and commercial brands into those devices.
Add RunAsynchronousCommands for each registry key to add. (Right-click RunAsynchronousCommand Properties and click Insert New AsynchronousCommand).
See the Unattended Windows Setup Reference for a full list of configuration options.
Step 4: Save the answer file
Save the answer file, for example: D:\AnswerFiles\BootToAudit-x64.xml.
NoteВ В Windows SIM will not allow you to save the answer file into the mounted image folders. В Step 5: Create a script
Since we specified a script to run in Step 3, let’s create that script now.
Copy the following sample script into Notepad, and save it as D:\AnswerFiles\SampleCommand.cmd.
Add the answer file and script to the image
Step 6: Mount an image and add the answer file
Use DISM to mount a Windows image. To learn how to mount an image, see Mount and modify a Windows image using DISM
Copy the answer file into the image into the \Windows\Panther folder, and name it unattend.xml. The Panther folder is one of the folders where Windows searches for an answer file. Create the folder if it doesn’t exist. If there’s an existing answer file, replace it or use Windows System Image Manager to edit/combine settings if necessary.
Unmount the image, committing the changes. For example:
where C is the drive letter of the drive that contains the mounted image.
This process may take several minutes.
When you apply your image, Windows will process your unattend file and will configure your settings based on what you specified in the unattend.
«Windows could not parse or process the unattend answer file for pass [specialize]» error message when you perform an in-place upgrade
This article provides help to fix an error (Windows could not parse or process the unattend answer file for pass [specialize]) that occurs when you perform an in-place upgrade.
Original product version: В Windows 7 Service Pack 1, Windows Server 2012 R2
Original KB number: В 2425962
Symptoms
Consider the following scenario:
- You are running a version of Windows 7 or of Windows Server 2008 R2 that was installed by using an Unattend.xml file.
- You start the computer from this image, and then you select the Repair in-place upgrade (overwrite installation) option.
- You start the in-place upgrade.
In this scenario, you receive the following error message: Windows could not parse or process the unattend answer file for pass [specialize].
Generally, the Unattend.xml files are used for OEM or corporate environment deployment. Therefore, the image could contain an Unattend.xml file, and you may not be aware that this file is included.
Cause
This problem occurs because the Unattend.xml file is applied during the in-place upgrade. This scenario is not supported.
More information
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base: 322756 How to back up and restore the registry in Windows
When this behavior occurs, you cannot recover the system. Therefore, you must perform a clean installation.
To avoid this behavior, you can remove a registry subkey before you use the OEM installation image to run an in-place upgrade. To do this, follow these steps:
- Log on to the computer by using a user account that has administrative permissions.
- Click Start, type regedit in the Start search box, and then in the Programs list, click regedit.exe.
- Locate and then right-click the following registry subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\UnattendBackup\ActiveSetup\FavoritesList\Favorite
In this subkey, is a placeholder for numbers that begin with 1.
Создание специализированного файла ответов ОС Create OS specialization answer file
Область применения: Windows Server 2019, Windows Server (половина ежегодного канала), Windows Server 2016 Applies to: Windows Server 2019, Windows Server (Semi-Annual Channel), Windows Server 2016
При подготовке к развертыванию экранированных виртуальных машин может потребоваться создать файл ответов специализации операционной системы. In preparation to deploy shielded VMs, you may need to create an operating system specialization answer file. В Windows это обычно называется файлом «unattend.xml». On Windows, this is commonly known as the «unattend.xml» file. Это можно сделать с помощью функции New-шиелдингдатаансверфиле Windows PowerShell. The New-ShieldingDataAnswerFile Windows PowerShell function helps you do this. Затем можно использовать файл ответов при создании экранированных виртуальных машин из шаблона с помощью System Center Virtual Machine Manager (или любого другого контроллера структуры). You can then use the answer file when you’re creating shielded VMs from a template by using System Center Virtual Machine Manager (or any other fabric controller).
Общие рекомендации по использованию файлов автоматической установки для экранированных виртуальных машин см. в разделе Создание файла ответов. For general guidelines for Unattend files for shielded VMs, see Create an answer file.
Скачивание функции New-ShieldingDataAnswerFile Downloading the New-ShieldingDataAnswerFile function
Функцию New-шиелдингдатаансверфиле можно получить из коллекция PowerShell. You can obtain the New-ShieldingDataAnswerFile function from the PowerShell Gallery. Если компьютер подключен к Интернету, его можно установить из PowerShell с помощью следующей команды: If your computer has Internet connectivity, you can install it from PowerShell with the following command:
unattend.xml Вывод можно упаковать в данные экранирования вместе с дополнительными артефактами, чтобы их можно было использовать для создания экранированных виртуальных машин из шаблонов. The unattend.xml output can be packaged into the shielding data, along with additional artifacts, so that it can be used to create shielded VMs from templates.
В следующих разделах показано, как можно использовать параметры функции для файла, unattend.xml содержащего различные параметры. The following sections show how you can use the function parameters for an unattend.xml file containing various options:
Базовый файл ответов Windows Basic Windows answer file
Следующие команды создают файл ответов Windows, который просто задает пароль учетной записи администратора и имя узла. The following commands create a Windows answer file that simply sets the administrator account password and hostname. Сетевые адаптеры виртуальной машины будут использовать DHCP для получения IP-адресов, а виртуальная машина не будет присоединена к домену Active Directory. The VM network adapters will use DHCP to obtain IP addresses, and the VM will not be joined to an Active Directory domain. При появлении запроса на ввод учетных данных администратора укажите требуемое имя пользователя и пароль. When prompted to enter an administrator credential, specify the desired username and password. Используйте «Администратор» для имени пользователя, если вы хотите настроить встроенную учетную запись администратора. Use «Administrator» for the username if you wish to configure the built-in Administrator account.
Файл ответов Windows с присоединением к домену Windows answer file with domain join
Следующие команды создают файл ответов Windows, который присоединяет экранированную виртуальную машину к домену Active Directory. The following commands create a Windows answer file that joins the shielded VM to an Active Directory domain. Сетевые адаптеры виртуальной машины будут использовать DHCP для получения IP-адресов. The VM network adapters will use DHCP to obtain IP addresses.
В первом запросе учетных данных будет запрашиваться информация об учетной записи локального администратора. The first credential prompt will ask for the local administrator account information. Используйте «Администратор» для имени пользователя, если вы хотите настроить встроенную учетную запись администратора. Use «Administrator» for the username if you wish to configure the built-in Administrator account.
Во втором запросе учетных данных будет предложено ввести учетные данные, которые имеют право присоединить компьютер к домену Active Directory. The second credential prompt will ask for credentials that have the right to join the machine to the Active Directory domain.
Не забудьте изменить значение параметра-имя_домена на полное доменное имя домена Active Directory. Be sure to change the value of the «-DomainName» parameter to the FQDN of your Active Directory domain.
Файл ответов Windows со статическими IPv4-адресами Windows answer file with static IPv4 addresses
Приведенные ниже команды создают файл ответов Windows, который использует статические IP-адреса, предоставленные диспетчером структуры в процессе развертывания, например System Center Virtual Machine Manager. The following commands create a Windows answer file that uses static IP addresses provided at deployment time by the fabric manager, such as System Center Virtual Machine Manager.
Virtual Machine Manager предоставляет три компонента для статического IP-адреса с помощью пула IP-адресов, адреса IPv6, адреса шлюза и адреса DNS. Virtual Machine Manager provides three components to the static IP address by using an IP pool: IPv4 address, IPv6 address, gateway address, and DNS address. Если требуется включить дополнительные поля или запрашивать пользовательскую конфигурацию сети, необходимо вручную изменить файл ответов, созданный сценарием. If you want any additional fields to be included or require a custom network configuration, you will need to manually edit the answer file produced by the script.
На следующих снимках экрана показаны пулы IP-адресов, которые можно настроить в Virtual Machine Manager. The following screenshots show the IP pools that you can configure in Virtual Machine Manager. Эти пулы необходимы, если вы хотите использовать статический IP-адрес. These pools are necessary if you want to use static IP.
В настоящее время функция поддерживает только один DNS-сервер. Currently, the function supports only one DNS server. Параметры DNS будут выглядеть следующим образом: Here is what your DNS settings would look like:
Вот как будет выглядеть сводка по созданию пула статических IP-адресов. Here is what your summary for creating the static IP address pool would look like. Вкратце, необходимо иметь только один сетевой маршрут, один шлюз и один DNS-сервер, и необходимо указать IP-адрес. In short, you must have only one network route, one gateway, and one DNS server — and you must specify your IP address.
Необходимо настроить сетевой адаптер для виртуальной машины. You need to configure your network adapter for your virtual machine. На следующем снимке экрана показано, где задать эту конфигурацию и как переключить ее на статический IP-адрес. The following screenshot shows where to set that configuration and how to switch it to static IP.
Затем можно использовать -StaticIPPool параметр, чтобы включить статические IP-элементы в файл ответов. Then, you can use the -StaticIPPool parameter to include the static IP elements in the answer file. После этого параметры, @IPAddr-1@ @NextHop-1-1@ и @DNSAddr-1-1@ в файле ответов будут заменены реальными значениями, указанными в Virtual Machine Manager во время развертывания. The parameters @IPAddr-1@ , @NextHop-1-1@ , and @DNSAddr-1-1@ in the answer file will then be replaced with the real values that you specified in Virtual Machine Manager at deployment time.
Файл ответов Windows с пользовательским языковым стандартом Windows answer file with a custom locale
Следующие команды создают файл ответов Windows с настраиваемым языковым стандартом. The following commands create a Windows answer file with a custom locale.
При появлении запроса на ввод учетных данных администратора укажите требуемое имя пользователя и пароль. When prompted to enter an administrator credential, specify the desired username and password. Используйте «Администратор» для имени пользователя, если вы хотите настроить встроенную учетную запись администратора. Use «Administrator» for the username if you wish to configure the built-in Administrator account.
Основной файл ответов Linux Basic Linux answer file
Начиная с Windows Server версии 1709, вы можете запускать определенные гостевые ОС Linux в экранированных виртуальных машинах. Starting with Windows Server version 1709, you can run certain Linux guest OSes in shielded VMs. Если вы используете Агент System Center Virtual Machine Manager Linux для специализации этих виртуальных машин, командлет New-ShieldingDataAnswerFile может создать для него совместимые файлы ответов. If you are using the System Center Virtual Machine Manager Linux agent to specialize those VMs, the New-ShieldingDataAnswerFile cmdlet can create compatible answer files for it.
В файле ответов Linux, как правило, вы включаете корневой пароль, корневой ключ SSH и, при необходимости, сведения о пуле статических IP-адресов. In a Linux answer file, you will typically include the root password, root SSH key, and optionally static IP pool information. Перед выполнением приведенного ниже сценария замените путь к общедоступной половине ключа SSH. Replace the path to the public half of your SSH key before running the script below.