Sysprep Fatal Error on New Windows 11 Pro System – WDS Deployment Blocked

Andrew Kowtalo 0 Reputation points
2025-06-02T20:02:28.5733333+00:00

Hello,

We are attempting to create a generalized image of Windows 11 Pro for use with Windows Deployment Services (WDS). However, we continue to encounter a fatal error when running Sysprep, even on a brand-new machine with minimal software.

Environment:

Windows 11 Pro 23H2, fully updated

No domain join, no antivirus

Installed only: Microsoft Teams, Office 365, Chrome, Adobe Reader, and Zoom

Sysprep command:

C:\Windows\System32\Sysprep\Sysprep.exe /oobe /generalize /shutdown

Troubleshooting Steps Already Taken:

Removed AppxProvisionedPackages via PowerShell

Disabled Windows Update and Store auto-updates

Reset GeneralizationState in registry

Deleted additional user profiles

Cleaned up component store with:

powershell

Copy

Edit

dism /online /cleanup-image /startcomponentcleanup /resetbase

Ensured there is no unattend.xml

Reviewed setupact.log and setuperr.log (available upon request)

Problem:

Sysprep always fails with the same fatal error, blocking our ability to capture a clean deployment image. We suspect there may be a modern AppX component or reserved package preventing Sysprep from completing.

Question:

What are the current Microsoft-supported best practices for Sysprepping a Windows 11 image with common productivity apps?

Is there a definitive list of AppX/Modern apps that need to be removed or a reliable cleanup method before Sysprep?

Urgency:

This is blocking our image deployment workflow across multiple endpoints. Any help or updated documentation would be highly appreciated.

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. BblytheX 705 Reputation points Microsoft External Staff
    2025-06-03T08:25:15.0433333+00:00

    Hi Andrew Kowtalo:

    Resolving Sysprep Fatal Error in Windows 11 23H2 for WDS Deployment:

    The most common causes of Sysprep failures in Windows 11 involve modern apps, provisioning packages, and system state issues.

    Here's a comprehensive solution:

    Step 1: Mandatory AppX Package Removal

    Run this PowerShell script as Administrator to remove problematic packages:

    PowerShell

    List of packages KNOWN to cause Sysprep failures in Win11

    $problematicApps = @(

    "MicrosoftTeams",
    
    "Microsoft.549981C3F5F10",       # Cortana
    
    "Microsoft.BingWeather",
    
    "Microsoft.Windows.Photos",
    
    "Microsoft.GetHelp",
    
    "Microsoft.Getstarted",
    
    "Microsoft.MicrosoftOfficeHub",
    
    "Microsoft.People",
    
    "Microsoft.YourPhone",
    
    "Microsoft.ZuneVideo",
    
    "Microsoft.GamingApp"
    

    )

    Remove for all users

    foreach ($app in $problematicApps) {

    Get-AppxPackage -Name "*$app*" | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
    

    }

    Remove provisioned packages

    foreach ($app in $problematicApps) {

    Get-AppxProvisionedPackage -Online | 
    
        Where-Object DisplayName -Like "*$app*" | 
    
        Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
    

    }

    Special removal for Teams Machine-Wide Installer

    Get-WmiObject -Class Win32_Product |

    Where-Object Name -match "Teams Machine-Wide Installer" | 
    
    ForEach-Object { $_.Uninstall() }
    

    Step 2: Critical Registry Fixes

    Apply these registry tweaks before Sysprep:

    PowerShell

    reg add "HKLM\SYSTEM\CurrentControlSet\Services\CDPSvc" /v "Start" /t REG_DWORD /d 4 /f

    reg add "HKLM\SYSTEM\CurrentControlSet\Services\CDPUserSvc" /v "Start" /t REG_DWORD /d 4 /f

    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "CleanupState" /t REG_DWORD /d 1 /f

    Step 3: Office 365 Licensing Cleanup

    Office activation state is a common blocker:

    PowerShell

    Reset Office licensing

    Stop-Service osppsvc

    Remove-Item -Path "C:\ProgramData\Microsoft\OfficeSoftwareProtectionPlatform*" -Force -Recurse

    Remove-Item -Path "C:\ProgramData\Microsoft\Office\16.0\Licensing*" -Force -Recurse

    Step 4: Advanced System Cleanup

    1. Reset scheduled tasks

    Get-ScheduledTask | Where-Object { $_.State -ne "Disabled" } | Disable-ScheduledTask

    1. Clear event logs

    wevtutil el | ForEach-Object { wevtutil cl $_ }

    1. Delete temporary profiles

    Get-CimInstance Win32_UserProfile |

    Where-Object { $_.Special -eq $false -and $_.Loaded -eq $false } | 
    
    Remove-CimInstance
    

    Step 5: Modified Sysprep Command

    Use this enhanced command sequence:

    cmd

    cd /d %windir%\system32\sysprep

    sysprep.exe /generalize /oobe /mode:vm /shutdown /quiet

    Microsoft-Supported Best Practices

    1. Image Maintenance Method:
      • Use Windows Configuration Designer to create provisioning packages instead of modifying golden images
      • Implement Windows Autopilot for zero-touch deployment
    2. AppX Management: PowerShell

    Microsoft's recommended cleanup command

    Get-AppxPackage -AllUsers |

       Where-Object NonRemovable -eq $false |
    
       Remove-AppxPackage -AllUsers
    
    1. Sysprep-Compatible Apps: | Safe to Keep | Must Remove | |--------------|-------------| | Notepad | Teams | | Calculator | Xbox | | Store* | Cortana | | Camera | Office Hub | *Store can be kept if you disable auto-updates

    Log Analysis Focus Areas

    Check setuperr.log for these critical markers:

    1. APPX entries (package failures)
    2. CDP (Connected Device Platform Service)
    3. TokenBroker errors
    4. OOBE provisioning failures
    5. Error 0x80073cf2 (package removal issues)

    Alternative Deployment Options

    If Sysprep continues to fail:

    1. DISM Capture (generalized image alternative): cmd dism /capture-image /imagefile:Z:\Win11Pro.wim /capturedir:C:\ /name:"Win11Pro_Deploy" /compress:max
    2. Enterprise Solutions:
      • Microsoft Endpoint Configuration Manager
      • Windows Deployment Services with custom PXE boot image
      • Azure Virtual Desktop golden image approach

    Final Recommendation:

    For mission-critical deployments, use the Windows Assessment and Deployment Kit (ADK) for Windows 11 23H2 which includes updated Sysprep modules and compatibility fixes.

    Microsoft's official stance is that heavily customized images should be replaced with provisioning packages and modern deployment methods.

    Please feel free to let me know if you still have any questions.

    Best regards,

    BblytheX

    0 comments No comments

  2. Andrew Kowtalo 0 Reputation points
    2025-06-03T13:31:08.46+00:00

    I fixed this myself by creating a new sysprep with just office chrome and adobe I put the remaining installers on the local drive

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.