Sysprep Error—Package xxxx was installed for a user, but not provisioned for all users.

Sysprep Error information :

Package Microsoft.LanguageExperiencePackzh-CN_19041.3.7.0_neutral__8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.

Solution :

Step1:找到setupact.log 的文件,找出错误日志来源。

Sysprep Error—Package xxxx was installed for a user, but not provisioned for all users._第1张图片

Step2:根据来源找到解决办法。

 Failed Way 1:打开Windows power shell ,以管理员运行如下命令。

Remove-AppxProvisionedPackage -Online -PackageName + 需要卸载掉的packagename

Sysprep Error—Package xxxx was installed for a user, but not provisioned for all users._第2张图片

但是我运行时,依旧是错误讯息,故放弃了,原版解决方法路径如下,大家试过成功的可以来报喜。Sysprep fails due to an app that was installed for a user, but not provisioned for all users – Azvise

Failed Way2 :打开Windows power shell ,以管理员运行如下命令。

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

但我运行出来的结果是我需要移除的包删不了,所以失败结尾。

Successful Way:

1.打开cmd,以管理员打开运行,运行如下命令,myUser 需要改成自己的账户名。

D:\> cd /d C:\Windows\system32\sysprep
C:\Windows\system32\sysprep\Actionfiles> takeown /F Generalize.xml
C:\Windows\system32\sysprep\Actionfiles> icacls Generalize.xml /grant myUser:(m)
C:\Windows\system32\sysprep\Actionfiles> notepad Generalize.xml 

2.找到下面的XML节点并删除它,保存文件并再次启动sysprep。


    
    
    
    

你可能感兴趣的:(Windows,windows,运维,系统架构)