Performing a manual installation of Windows Server is acceptable if you have only a single machine to install. However, if you deploy multiple instances, you want to use an automated approach. One of the oldest mechanisms provided by Microsoft for this purpose is answer files. This article shows you how to create them with Windows System Image Manager.

A newer approach than answer files is cloning an existing installation by writing it to a WIM archive. After generalizing the reference installation with sysprep, capture it using DISM (see Create a customized Windows 10 image using PowerShell and Hyper-V). But some admins still prefer an automated setup with answer files, because it usually results in a cleaner installation of Windows Server.

Installing Windows Server 2022

Windows Server 2022 supports an answer file similar to previous versions of the operating system. It intuitively provides "answers" to the typical questions that the installer prompts during a manual setup. Building the answer file would not be an easy undertaking if you were to write the XML file manually. However, with the Windows Assessment and Deployment Kit (ADK), Microsoft provides the necessary tools.

Hence, you first have to install the Windows Assessment and Deployment Kit. It contains the tool we need to write an answer file: the Windows System Image Manager (WSIM). You want to grab the latest download of the ADK, as you need the latest version to "understand" the latest Windows Server 2022 build (download ADK).

Downloading the Windows Assessment and Deployment Kit for Windows Server 2022

Downloading the Windows Assessment and Deployment Kit for Windows Server 2022

Installing the ADK is a simple "next, next, finish" process. On the Select the features you want to install screen, I have checked Deployment Tools, among others. They contain WSIM.

Selecting Windows ADK features for installation

Selecting Windows ADK features for installation

Extract Install.wim for Windows Server 2022 Preview

Now that we have the ADK installed, you will need to download the Windows Server 2022 Preview media. It is available for download in the official Microsoft Preview center here. Select the ISO file for download.

Downloading Windows Server 2022 Preview ISO

Downloading Windows Server 2022 Preview ISO

Once you download the ISO, mount this in Windows, and copy the install.wim from the Sources folder to a writeable folder for WSIM.

Install.wim copied from the mounted Windows Server 2022 ISO file

Install.wim copied from the mounted Windows Server 2022 ISO file

Mount Install.wim in WSIM

Once installed, you can launch the WSIM. This tool provides the GUI to work with and create answer files for Windows Server and client. To get started with Windows Server 2022, note the Select a Windows image or catalog file option under Windows Image. Right-click this and choose Select Windows Image

Launching the WSIM

Launching the WSIM

Select the specific Windows Server 2022 image for creating an answer file.

Selecting the Windows Server 2022 Image to work with in WSIM

Selecting the Windows Server 2022 Image to work with in WSIM

Answer Yes to the prompt to create a catalog file.

Creating a catalog file for the Windows Server 2022 image

Creating a catalog file for the Windows Server 2022 image

After the catalog process is complete, right-click the Create or open an answer file option and select New answer file.

Creating a new answer file after cataloging Windows Server 2022 install.wim_

Creating a new answer file after cataloging Windows Server 2022 install.wim_

Now you see the various components or stages of the installation created for customization. These include:

  • 1 windowsPE
  • 2 offlineServicing
  • 3 generalize
  • 4 specialize
  • 5 auditSystem
  • 6 auditUser
  • 7 oobeSystem
New Windows Server 2022 answer file is created for editing

New Windows Server 2022 answer file is created for editing

How do you know which sections to add? When you drag a component from the Windows Image pane to the answer file, WSIM will only allow you to drop it to the appropriate stages of the setup process. Also, in the context menu of every component, all incompatible passes are grayed out.

You can only drag and drop components to the matching setup pass

You can only drag and drop components to the matching setup pass

If you already have an answer file for Windows Server 2019, you can use it as a template for Windows Server 2022, as there are few differences.

Below, you see the first two components in the image of the sample answer file shown. These are:

  • Microsoft-Windows-International-Core-WinPE
  • Microsoft-Windows-Setup
Adding settings in the Windows System Image Manager

Adding settings in the Windows System Image Manager

Below, I have added the answer file section to choose the UILanguage and set this to English US.

Customizing the components of your answer file in the WSIM for Windows Server 2022

Customizing the components of your answer file in the WSIM for Windows Server 2022

Below, I have added the Microsoft-Windows-Setup_neutral section to add the disk and partition configuration for the automated deployment of Windows Server 2022.

Modifying disk partitions and format options for Windows Server 2022

Modifying disk partitions and format options for Windows Server 2022

After you have configured the settings you want for your automated deployment of Windows Server 2022, navigate to File > Save Answer File, which prompts you for a location to save the file. In many cases, the name needs to be autounattend.xml.

Save your Windows Server 2022 answer file for use with your automation tool of choice

Save your Windows Server 2022 answer file for use with your automation tool of choice

Using this process with the WSIM, you step through each section you want to add to your configuration. I like WSIM because it has dropdown boxes for each property element for each section, so you are not left guessing what valid options are available. If you want to download and view a full sample Windows Server 2022 answer file for automated deployment, you will find the answer file here.

Wrapping up

Building a Windows Server 2022 answer file is made easy with the latest version of the Windows Assessment and Deployment Kit, which provides the tools to write the XML answer file using a GUI interface.

Subscribe to 4sysops newsletter!

As shown, using the WSIM GUI tool, you can add each section of the deployment and build the answer file without worrying about XML syntax and formatting.

avatar
1 Comment
  1. Seth Hollist 3 months ago

    I had to make the install.win file writable as well. Copying it from the ISO, it had the read-only attribute set on it.

Leave a reply

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account