This post is part of a series illustrating how to automate the process of deploying an AD Lab. This article details the process for customizing the Windows installer ISOs to automate the Windows installation.
You can use my automation script, OZO AD Lab Customize ISOs to perform these steps with a single command!
Assumptions
- Windows is installed to the
Cdrive. - ISO files will mount to the
Ddrive. - The latest OZO AD Lab release has been downloaded and extracted to
C:\ozo-ad-lab. - The Microsoft Windows evaluation edition ISOs are downloaded to
C:\ozo-ad-lab\ISOand renamed as described in Customization Prerequisites.
Customize the Windows Installer ISOs
Create the Server ISO
Double-click to mount the Windows Server Evaluation ISO and run the following commands in an Administrator PowerShell to copy the contents to the Server folder.
Copy-Item -Recurse -Path "D:\*" -Destination "C:\ozo-ad-lab\Builds\Server\"
Eject the ISO. Then move the install WIM to the WIM folder:
Move-Item -Path "C:\ozo-ad-lab\Builds\Server\sources\install.wim" -Destination "C:\ozo-ad-lab\WIM\Windows Server\"
Enumerate the editions contained in the WIM.
Get-WindowsImage -Path "C:\ozo-ad-lab\WIM\Windows Server\install.wim"
Export the desired Index back to the Build folder (for example for Index 2, Windows Server 2025 Standard).
Export-WindowsImage -SourceImagePath "C:\ozo-ad-lab\WIM\Windows Server\install.wim" -SourceIndex 2 -DestinationImagePath "C:\ozo-ad-lab\Builds\Server\sources\install.wim"
In C:\ozo-ad-lab\Builds\Server, modify Autounattend.xml and OZO AD Lab\ as needed. Then create the new ISO:
& "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -u2 -udfver102 -t -lOZO-AD-Lab-Server -bC:\ozo-ad-lab\Builds\Server\efi\microsoft\boot\efisys.bin C:\ozo-ad-lab\Builds\Server C:\ozo-ad-lab\ISO\OZO-AD-Lab-Server.iso
Create the Client ISO
Double-click to mount the Windows Client Evaluation ISO and run the following commands in an Administrator PowerShell to copy the contents to the Client folder.
Copy-Item -Recurse -Path "D:\*" -Destination "C:\ozo-ad-lab\Builds\Client\"
Eject the ISO. Then move the install WIM to the WIM folder:
Move-Item -Path "C:\ozo-ad-lab\Builds\Client\sources\install.wim" -Destination "C:\ozo-ad-lab\WIM\Windows Client\"
Enumerate the editions contained in the WIM.
Get-WindowsImage -Path "C:\ozo-ad-lab\WIM\Windows Client\install.wim"
Export the desired Index back to the Build folder (for example for Index 1, Windows 11 Enterprise).
Export-WindowsImage -SourceImagePath "C:\ozo-ad-lab\WIM\Windows Client\install.wim" -SourceIndex 1 -DestinationImagePath "C:\ozo-ad-lab\Builds\Client\sources\install.wim"
In C:\ozo-ad-lab\Builds\Client, modify Autounattend.xml and OZO AD Lab\ as needed. Then create the new ISO:
& "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\oscdimg.exe" -u2 -udfver102 -t -lOZO-AD-Lab-Client -bC:\ozo-ad-lab\Builds\Client\efi\microsoft\boot\efisys.bin C:\ozo-ad-lab\Builds\Client C:\ozo-ad-lab\ISO\OZO-AD-Lab-Client.iso
Copy the ISOs
Copy the OZO-AD-Lab-* ISOs from C:\ozo-ad-lab\ISO to your Downloads folder. The next part in this series, Installation, expects to find two customized ISO files in your Downloads folder:
OZO-AD-Lab-Client.isoOZO-AD-Lab-Server.iso
[Optional] Clean Up
If desired, you may delete C:\ozo-ad-lab to free up local disk space.
Part I – Introduction
Part II – Customization
- Customization Prerequisites
- Customize the Installer ISOs