Windows unattended installation file

Windows Unattended Installation 2.6

MultiSet — Автоматический установщик программ и Windows

Хотите создать инсталляционный диск WindowsXP, который бы автоматически устанавливал систему, не задавая вопросов про имя пользователя, ключ продукта, временные и региональные настройки? При этот автоматически устанавливаются ваши любимые приложения, прописываются нужные ключи реестра, обновляются драйвера, ставяться новые заплатки (сервис паки) от ОС. Все это возможно и просто сделать с помощью программы Almeza MultiSet.

Замечательная особенность программы MultiSet состоит в том что от меня не требуется ни каких специальных знаний, т.е. знаний написания каких либо скриптов. Мною создано несколько DVD дисков которые автоматически устанавливают WindowsXP, вместе с необходимым набором программ (MS Office, Nero, FireFox, 1C. ) также устанавливается автоматически и сервис паки, драйвера. Еще одна ключевая опция программы — это автоматическая настройка программ включая тюнинг WindowXP т.е. можно автоматически устанавливать нужные настройки.
Рекомендую эту программу всем кому приходится часто переустанавливать ОС, устанавливать и настраивать наборы программы!

С помощью программы MultiSet можно создать автономный — универсальный диск для автоматической установки программ с любого носителя информации(CD/DVD/Flash/Hard Drive) на любое количество компьютеров!

MultiSet — это автоматический установщик программ c простым и интуитивно понятным интерфейсом. Очень часто пользователю, после установки операционной системы ,требуется достаточно много времени, чтобы установить нужные приложения. При этом приходится менять диски в приводах CD-ROM, DVD-ROM, вводить регистрационные данные и выполнять другие рутинные операции, которые занимают достаточно много времени. Программа MultiSet установит Все требуемые программы автоматически. При этом Вам не нужно писать ни строчки кода!

Create Unattend Answer File for Windows Server 2019 Automated Packer Installation

Recently, I have been working a lot with Packer installations in the home lab to configure automated builds of Server operating systems to have always “up-to-date” copies of Windows Server templates so that you shortcut all the time needed to build up a Windows Server operating system, patch the OS, and then install your applications. With Packer, you can perform all of these tasks and have these templates on hand and ready to go at a moment’s notice. One of the first things you will need to do is either create or download a Windows Server unattend answer file. In this post, we will take a look at what an unattend answer file is as well as resources that can be used to either create unattend answer file for Windows Server 2019 automated packer installation or download one.

What is a Windows Server Answer File?

The answer file is a special file that is in an XML format that contains setting definitions and values for the configuration settings you want to automated during the installation of a Windows Server operating system installation. The configuration options include how to partition disks, where to find the Windows image to be installed, product keys to apply, and other commands you would like to run. Basically, you can place in the answer file all the configuration that you can carry out manually using the GUI Windows Server operating system installation in the Windows PE environment and then in the “out of the box” installation setup wizard.

There are (7) components in the unattend answer file that can be customized to provide “answers” to the configuration in question. These seven components provide the configuration for the various parts of the installation and configuration of Windows Server. The are the following:

Create Unattend Answer File for Windows Server 2019 Automated Packer Installation

The Unattend.xml answer file is typically the name most use for the special answer file using for unattended installations of Windows Server. However, you can call the file anything you would like. While you could simply use Notepad or another text editor to create an Unattend.xml file from scratch, being as this is an XML file that is very sensitive to syntax and the proper tags being used, etc, doing it that way would be fairly difficult.

Microsoft has provided a tool that is very helpful in creating these unattend answer files for unattended installations of Windows Server and Windows 10 operating systems. The tool is part of the Windows Assessment and Deployment Kit. It is called the Windows System Image Manager.

Читайте также:  Подработка системным администратором linux

The Windows System Image Manager or Windows SIM provides an easy way to create unattend answer files using this GUI tool and the component sections described above as part of the answer file. You can use the GUI tool to create the “answers” the configuration questions presented in the GUI. Then once finished, the Windows SIM creates the file in the correct format/syntax.

Installing Windows System Image Manager

To install the Windows System Image Manager, you need to download the Windows Assessment and Deployment Kit found here:
https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install

I have found to avoid issues with images and catalog creation, it is best to use the version of the Windows ADK that corresponds to the version of the operating system you are working with.

After downloading the Windows Assessment and Deployment Kit, run the installer.

On the features you want to install page, the only component that we need to install for the Windows System Image Manager is the Deployment Tools.

The installation finishes successfully for the Windows SIM.

After installation, if you are struggling to find the program shortcut for the Windows ADK and specifically Windows System Image Manager, the program group is found under Windows Kits under the Windows 10 Start Menu. Launch the Windows System Image Manager.

Before creating an answer file for a particular unattended installation of Windows Server 2019, you need to download the Windows Server 2019 media. After downloading the media, copy the install.wim file from the media to a writeable folder on your workstation. We will use the install.wim file to create the catalog file which is required for creating a new answer file. The catalog file is created after all the files are scanned from the .wim file.

After you have copied the Windows Image from the media to the location you want to work with it, you right click the Select a Windows image and choose Select Windows Image to browse to the image file.

As you know the installation media has the images for the various versions of Windows Server including Standard, Datacenter, and Core. Here I am choosing the Server Standard image.

Once you choose an image, a catalog file will need to be created to work with the image and create the Answer File. You will see the message displayed about creating a catalog file for the Image. Click Yes.

Once the Image is mounted and the catalog file is created, right click the Create or open an answer file to create a new Answer file.

Select to create New Answer File.

As shown the Answer File is created with the (7) components for customization listed for the various configuration passes.

To add custom configuration, right-click the various components and under the Windows Image and Add Settings to Pass for adding the configuration you want to be passed along in the Answer File.

After adding your configuration to the various passes and components. Simply select File > Save Answer File to save the file to disk so you can use it with your Packer build.

Below is an example unattend answer file for Windows Server 2019 created for use with Packer.

en-US en-US en-US en-US en-US 1 250 Primary 2 true Primary 1

Windows Server 2019 Unattended Install Windows Updates

When performing an unattended installation of Windows Server, one of the great things you can do is also install any available Windows Updates that may be available for the install. In playing around with Packer recently, I have been working on a build process for the home lab that allows having an up-to-date Windows Server build in the form of a template always available for use in deploying workloads in the lab. Let’s take a quick look at Windows Server 2019 Unattended Install Windows Updates and how this can easily be accomplished with the autologon functionality and the ability to run scripts during the first logon session of an unattended installation.

Configuring AutoLogon in the Unattend Answer File

Using the Uattended Answer File in the Windows Server 2019 automated installation, we can both set the password for the administrator user as well as set the AutoLogon flag to allow the account to be autologged in for the configured number of times during the unattended installation. To do that, let’s look at the code. Below, you will see the password being configured for the Administrator account and enabled. This can be set to whatever account you wish.

Additionally, the section powershell -ExecutionPolicy Bypass -File a:\configuration.ps1 is setting a script file to execute after the autologon takes place.

Windows Server 2019 Unattended Windows Server Install Windows Updates

The configuration.ps1 file can contain any number of useful PowerShell or other command line statements to customize or configure various aspects of the system. One of those commands and sections of configuration we can add is the following:

Читайте также:  Беспроводной приемник геймпада xbox 360 для windows драйвера

This command is pulling down the PSWindowsUpdate PowerShell module which allows easily installing Windows Updates using PowerShell. The first line installs the Nuget provider which is needed for the PSWindowsUpdate installation.

In the next line the PSWindows Update module is used to get the available Windows Updates from the MicrosoftUpdate server, install them, ignoreuserinput, and accept any prompts. The server is directed to AutoReboot which will automatically reboot the server after the installation is finished. All of this is logged to the ‘c:\windowsupdate.log’ file.

I haven’t seen a graceful way to trigger another start of the script if a reboot is needed in between installing updates. However, one thing I have been experimenting with that seems to be working is add a RunOnce script to kick off another PowerShell script to run the command once again.

The code below adds a RunOnce entry that directs it to run a batch file that runs a snippet of PowerShell code to run the Get-WindowsUpdate command once again.

The below runs the command once again. This time, it ignores the reboot and then sets the AutoLogonCount to 0.

You can literally add any number of directives here with configuring your Windows Server unattended installations. I have added many registry customizations as well as custom tools. You can run ansible configuration scripts for WinRM, or chef configuration tools to have all of these types of things available already in the box housed in the virtual machine template file.

Using Packer to drive the unattended installation of Windows Server 2019 allows scheduling and controlling the process so that your virtual machine can be built totally “hands off” in an automated way and then automatically turned into a virtual machine template. All you have to do is feed it an ISO file from Microsoft and the other relevant configuration in the unattend answer file.

Benefits of Windows Server 2019 Unattended Install Windows Updates installation

Building up a new Server using the unattended approach is vastly beneficial since it is automated. This takes out the possibility of human error and you know it is done the same way each time it is ran, identically. Also, all of the time waiting on updates is happening outside of when you need the template. This can be scheduled during the night to perform a new build of the server, pulling all the available updates at the time. With these and many other benefits, there is much value that can be seen from the unattended Windows Server install.

Wrapping Up

Hopefully this look at Windows Server 2019 Unattended Install Windows Updates will help some who may want to accomplish this in their automated builds of Windows Server. Using Packer the full process can be automated from beginning to end.

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.

Читайте также:  Unable to use windows update

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.

Оцените статью