Forum Discussion
Windows 11 Sysprep /Generalize Errors after restart
Harry-TSLWhat I'm about to say is really obvious, so it shouldn't surprise you. Even if you're using a DIY approach like this, you should apply the cumulative updates / drivers with DISM first, and then finalize the image. Anything at that point you could capture in a VM and apply as a siloed provisioning package ( without needing to generalize the image, as none of these things create a unique SID string that you have to remove by generalizing with sysprep. ) If you have to complete a set of tasks, like adding features, windows universal apps / app updates, or installing some types of software, then of course that creates pending actions that you can usually only resolve with sysprep and audit mode. The end-result should actually be an WIM / FFU image that you can apply unattended using WinPE cmdlets and a script, although initially you should start with a pre-patched ISO image. You could still do three quarters of these things WITHOUT generalizing the image or wasting your own time:
"Desktop manufacturing" -> https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/
Add and Remove Driver packages to an offline Windows Image -> https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/add-and-remove-drivers-to-an-offline-windows-image
Add or Remove Packages Offline Using DISM -> https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/add-or-remove-packages-offline-using-dism
"Alternatively, the siloed provisioning packages can be captured using a VM instead of a physical device"
Scenarios for using siloed provisioning packages -> Capturing and applying independent applications -> https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/siloed-provisioning-packages?view=windows-11#capturing-and-applying-independent-applications
"/Apply-SiloedPackage can only be run once against a Windows image, but /PackagePath can used more than once in the same command to apply multiple SPPs." -> https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/dism-image-management-command-line-options-s14?view=windows-11#apply-siloedpackage
Windows 11, version 21H2 update history -> https://support.microsoft.com/en-us/topic/windows-11-update-history-a19cd327-b57f-44b9-84e0-26ced7109ba9
History of Cumulative Updates for .NET Framework for Windows 11 -> https://support.microsoft.com/en-us/topic/history-of-cumulative-updates-for-net-framework-for-windows-11-b56e9c5b-fc56-49fb-9490-dc09b0b89758
Here's an example you can easily edit, although you'd have to create all your own scripts yourself:
@ECHO OFF
MKDIR "C:\Scratch_Win"
MKDIR "C:\Mount"
DISM /Mount-Image /ImageFile:"C:\Win_11\sources\install.wim" /Index:1 /MountDir:"C:\Mount"
DISM /Image:"C:\Mount" /ScratchDir:"C:\Scratch_Win" /Add-Package /PackagePath:"C:\Answer_Files\Win11\22H2\windows11.0-kb5021255-x64_2830fb558a628b0a1847a0025d3da14928f82a5e.msu" /PackagePath:"C:\Answer_Files\Win11\22H2\windows11.0-kb5020882-x64-ndp481_c1b9ed0bbd7bec142c66c5b27f82533b04ee807a.msu"
DISM /Cleanup-Image /Image:"C:\Mount" /ScratchDir:"C:\Scratch_Win" /StartComponentCleanup /ResetBase
DISM /Unmount-Image /MountDir:"C:\Mount" /Commit
DISM /Cleanup-Mountpoints
RMDIR /S /Q "C:\Scratch_Win"
RMDIR /S /Q "C:\Mount"
REM https://www.catalog.update.microsoft.com/Search.aspx?q=KB5021255 11 -"GDR-DU" -"Dynamic" -"ARM64"
REM https://www.catalog.update.microsoft.com/Search.aspx?q=KB5021090 11 -"GDR-DU" -"Dynamic" -"ARM64"