Windows: Sysprep fails with “Package xy installed for a user, but not provisioned for all users”


when you call sysprep and it fails (logfile C:\windows\System32\sysprep\panther\setuperr.log) with an error “Package xy installed for a user, but not provisioned for all users” you have to remove those packages from the user profile.

Root cause is that the user has installed those package(s) but they are not provisioned for all users.

To solve this get a list of all provisioned appx apackages and remove the packages for all users which are not provisioned. Error can ignored..

PS D:\> $aProvPackages=@(Get-AppxProvisionedPackage -Online).PackageName
PS D:\> Get-AppxPackage -AllUsers | ?{ -not ($aProvPackages -contains $_.PackageFullName ) } | %{write-host $_;Remove-AppxPackage -AllUsers -Package $_}


Advertisment to support

9 thoughts on “Windows: Sysprep fails with “Package xy installed for a user, but not provisioned for all users””

  1. Thank you Michael!
    After searching various TechNet forums and getting nowhere, your code managed to get my image Sysprep’d.

  2. 1.Navigate to C:\windows\system32\ and search for the sysprep folder, go to properties change the ownership of the folder to to the local admin by changing the permissions in Advance menu.

    2. After you take the ownership of the folder you can open sysprep\actionfiles and edit the Generalize.xml and remove the following entry from there.

    	<imaging exclude="">
    		<assemblyIdentity name="Microsoft-Windows-AppX-Sysprep" version="10.0.19041.1566" publicKeyToken="31bf3856ad364e35" processorArchitecture="amd64" versionScope="NonSxS"/>
    		<sysprepOrder order="0x1A00"/>
    		<sysprepValidate methodName="SysprepGeneralizeValidate" moduleName="$(runtime.system32)\AppxSysprep.dll"/>
    		<sysprepModule methodName="SysprepGeneralize" moduleName="$(runtime.system32)\AppxSysprep.dll"/>

    3. Save as the Generalize.xml on any desired location and then rename the existing Generalize.xml to old and replace it with the new one.

    4. Run sysprep Generalize and see if that works for you.

  3. Thank you! Great post

    I didn’t really worked for me, but it served to enlighten some other causes

    What did work for me was creating a new user (admin) and removing all the others (I only had one). Then, after restarting the PC, sysprep worked as a charm

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.