I feel I’m going crazy. I’ve done this a million times before and now its no longer working.
Problem: I’m trying to update the wim with the new SCCM Client (have to due to it being a nested WIM File within a server deployment) along with updating the Windows Updates on it.
I have an Unattend.xml file which includes server name and IP address and the below process works using one of our existing WIM’s.
- Create the VHDX from the WIM:
Convert-WindowsImage -SourcePath "E:\path\VMWIM.wim" -Size 100GB -DiskType Dynamic -VHDFormat VHDX -VHDPartitionStyle GPT -VHDPath "E:\path\VMWIM.vhdx"
- Mount VHDX for a sanity check:
Mount-WindowsImage -ImagePath "E:\path\VMWIM.vhdx" -Path E:\path\Mount -Index 1
- Create WIM:
New-WindowsImage -CapturePath E:\TempVHD\Mount -Name VMWIM -ImagePath E:\TempVHD\VMWIMv3.4.wim -Description "Server 2012 R2 VMWIM" -Verify
- Create VM from above WIM:
C:\path\Convert-WindowsImage.ps1 -WIM C:\path\VMWIM.wim -Size 100GB -DiskType Dynamic -VHDFormat VHDX -VHDPartitionStyle GPT -Unattend C:\unattend.xml -VHD D:\path\vmvhd.vhdx
When I do the above the Unattend.xml and Specialize Settings (Name, IP, DNS, WINS) are all applied.
If I were to make changes to the VHDX Created in Step 1, change SCCM Client, run Windows Updates, then I’d run a sysprep with shutdown and carry on with step 2. Once I got to Step 4 the vhdx file is created and windows boots, but the specialize section is ignored (Name, IP, DNS, WINS). Even though I can see the unattend.xml has been copied to c:\unattend.xml and c:\windows\panther\unattend.xml (using exactly the same unattend file)
What am I doing wrong?