Skip to content

vBlog.nl

All about technology

Menu
  • Home
  • VMware Cloud Director
  • vSphere
  • Automation
    • PowerCLI
    • PowerShell
    • Terraform
  • NSX
  • Horizon DaaS
  • About Us
Menu

Windows 10 sysprep fails

Posted on January 28, 2019

When you create a windows 10 base image, you can do that with two versions of windows. The windows 10 LTSC (Long Term Servicing Channel) or with Windows 10 SAC (Semi-Annual Channel).

The windows 10 SAC is the version we are all familiar with and provides us all the new features microsoft gives use. Including all the pre-installed trash like Candy Crunch etc.

But creating a base image for windows 10 SAC can be a challenges…

I installed windows 10 (next, next, finish) and tried to create a image with this installation. But my Horizon DaaS gives me the following message:

Power off virtual machine ‘imagename’ – Timeout Error
Waited 8 minutes for virtual machine ‘imagename’ to power off.

The VMware kb tells you to extend the sysprep timeout policy, or if that not works check the sysprep log (C:\Windows\System32\Sysprep\Panther.log)
Source: https://kb.vmware.com/s/article/2126179

Off course extending the policy did not work for me….. So I needed to check the sysprep log.
When I opened the log I saw errors like:

2019-01-16 11:17:27, Error      [0x0f00d8] SYSPRP WinMain:Hit failure while pre-validate sysprep generalize internal providers; hr = 0x80073cf2
2019-01-16 11:17:27, Error                 SYSPRP Package A278AB0D.DragonManiaLegends_4.2.1.0_x86__h6adky7gbf63m was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.
2019-01-16 11:17:27, Error                 SYSPRP Failed to remove apps for the current user: 0x80073cf2.
2019-01-16 11:17:27, Error                 SYSPRP Exit code of RemoveAllApps thread was 0x3cf2.
2019-01-16 11:17:27, Error                 SYSPRP ActionPlatform::LaunchModule: Failure occurred while executing ‘SysprepGeneralizeValidate’ from C:\Windows\System32\AppxSysprep.dll; dwRet = 0x3cf2
2019-01-16 11:17:27, Error                 SYSPRP SysprepSession::Validate: Error in validating actions from C:\Windows\System32\Sysprep\ActionFiles\Generalize.xml; dwRet = 0x3cf2
2019-01-16 11:17:27, Error                 SYSPRP RunPlatformActions:Failed while validating Sysprep session actions; dwRet = 0x3cf2
2019-01-16 11:17:27, Error      [0x0f0070] SYSPRP RunExternalDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x3cf2
2019-01-16 11:17:27, Error      [0x0f00d8] SYSPRP WinMain:Hit failure while pre-validate sysprep generalize internal providers; hr = 0x80073cf2

According to the microsoft kb you need to do the following:

Import-Module Appx
Import-Module Dism
Get-AppxPackage -AllUser | Where PublisherId -eq 8wekyb3d8bbwe | Format-List -Property PackageFullName,PackageUserInformation
Remove-AppxPackage -Package <packagefullname>

Source: https://support.microsoft.com/en-us/help/2769827/sysprep-fails-after-you-remove-or-update-windows-store-apps-that-inclu

But it is a lot of work to do it for each app, so automation is key you should think..

#delete them all.
Get-AppxPackage | ? {$_.PublisherId -eq '8wekyb3d8bbwe'} | Remove-AppxPackage

Unfortunately this did not what I expected, and had lots of errors:
Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF3, Package failed updates, dependency or conflict validation.
Windows cannot remove framework Microsoft.NET.Native.Runtime.2.2_2.2.27011.0_x86__8wekyb3d8bbwe because package(s) Microsoft.SkypeApp Microsoft.Xbox.TCUI
Microsoft.WindowsMaps currently depends on the framework. Removing all packages that depend on the framework automatically removes the framework.
NOTE: For additional information, look for [ActivityId] 0a021dff-ad7c-0001-315d-020a7cadd401 in the Event Log or use the command line Get-AppxLog -ActivityID 0a021dff-ad7c-0001-315d-020a7cadd401

It turns out that almost all apps have dependencies. In this case you need to uninstall all apps with dependecies and leave the apps without dependecies like ‘Microsoft.NET.Native.Runtime.2.2_2.2.27011.0_x86__8wekyb3d8bbwe’ alone.

The final code looks like this:

$Packages = Get-AppxPackage | ? {$_.PublisherId -eq '8wekyb3d8bbwe'}
foreach($package in $packages){if($package.Dependencies){Remove-AppxPackage -Package $package.packagefullname}}

Be aware of the fact that you need to run this code every time you reseal your sysprep image..!!

If the above code doesn’t work you can also try this one:

Import-Module Appx
Import-Module Dism
$packages = Get-AppxPackage -AllUser | Where PublisherId -eq 8wekyb3d8bbwe
foreach ($package in $packages) {Remove-AppxPackage -Package $package.packagefullname -AllUsers}

Loading

Share on Social Media
twitter facebook linkedin reddit emailwhatsapptelegram

2 thoughts on “Windows 10 sysprep fails”

  1. Scott says:
    March 21, 2019 at 3:13 pm

    I find using the following works for me every time.

    get-appxpackage -allusers | remove-appxpackage

    Reply
  2. Thiebauld says:
    July 7, 2020 at 2:49 pm

    Thanks for the help.
    Second code did solve the issue. Didn’t have to import both module

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent articles

  • vCloud Director API – Couldn’t connect to cloud server with the provided session id May 24, 2023
  • Horizon DaaS – Maximum sessions exceeded May 9, 2023
  • VMware Cloud on AWS with FSx for NetApp ONTAP December 28, 2022
  • Workspace ONE Access – Change certificate December 22, 2022
  • UI themes for VMware Cloud Director 10.4.1 and later December 16, 2022
  • VMware Tanzu Kubernetes Grid December 15, 2022
  • Workspace One Access – Not logged in to server FQDN. Please invoke Save before Sync December 12, 2022
  • NSX Edge configuration has failed. 1G hugepage support required. December 7, 2022
  • Horizon DaaS – Unable to connect to Desktop November 24, 2022
  • How to: Request and Install a Lets Encrypt Wildcard SSL on VMware Cloud Director 10.4 October 17, 2022

Tags

Automation bootstrapping Container Service Extension Credential Manager Desktone.log ESXi EUC EXi GPU Horizon DaaS Instant-Clone Logging NSX nsx-t PowerCLI PowerShell Putty Raspberry PI SSL Tanzu Terraform update vcd-cli vCenter vCloud vCloud Availability vCloud Director VDI vGPU VMware VMworld vSAN vSphere vVols workspace one Zerto

VMware Cloud Provider Blog

  • In the cloud world, one size doesn’t fit all
    by Vijoo Chacko on June 2, 2023 at 7:25 am

    The size make-up of enterprises in an industry can vary from sector to sector. Take for example, the commercial aviation industry. When did you last fly in a commercial plane that was not a Boeing or an Airbus? This is an industry clearly dominated by two major companies. Whereas the automotive industry is an example … Continued The post In the cloud world, one size doesn’t fit all appeared first on VMware Cloud Provider Blog.

  • Reminder: VMware Cloud Director Availability 4.2 and 4.3 End of General Support Approaching
    by Nikolay Patrikov on May 23, 2023 at 3:17 pm

    Keeping VMware Cloud Director Availability always up-to-date guarantees having all the latest and greatest features available for you and your tenants. But one more reason to consider it now is VMware Cloud Director Availability 4.2.x and 4.3.x will reach End of General Support (EOGS) on June 10, 2023, and will no longer be available for download from the VMware download pages. To ensure you … Continued The post Reminder: VMware Cloud Director Availability 4.2 and 4.3 End of General Support Approaching appeared first on VMware Cloud Provider Blog.

  • VMware Aria Rebranding on VMware Cloud Partner Navigator
    by Sulakshna Shrivastava on May 23, 2023 at 2:06 am

    We recently announced the renaming of the products within our Cloud Management family. These Aria rebranding updates have been implemented on the VMware Cloud Partner Navigator portal The post <strong>VMware Aria Rebranding on VMware Cloud Partner Navigator</strong> appeared first on VMware Cloud Provider Blog.

  • Upgrade vSphere now: vSphere 6.5 and 6.7 end of technical guidance is coming this November
    by Christopher Wong on May 20, 2023 at 3:00 pm

    With the general availability of VMware vSphere 8 Update 1, we would like to remind our Cloud Services Provider partner community that the end of general support for vSphere 6.5 and vSphere 6.7 was October 15, 2022. These versions are now under technical guidance until November 15, 2023. During the technical guidance phase, VMware does … Continued The post Upgrade vSphere now: vSphere 6.5 and 6.7 end of technical guidance is coming this November appeared first on VMware Cloud Provider Blog.

  • VMware NSX Migration for VMware Cloud Director 1.4.2 is now GA
    by Jaikishan Tayal on May 9, 2023 at 2:05 pm

    We’re thrilled to announce the release of the VMware NSX Migration tool for VMware Cloud Director 1.4.2! What is this Tool? If you are unaware of the VMware NSX Migration for VMware Cloud Director Tool, it can help you migrate your environment from NSX for vSphere to NSX T Data Center if you are currently … Continued The post VMware NSX Migration for VMware Cloud Director 1.4.2 is now GA appeared first on VMware Cloud Provider Blog.

©2023 vBlog.nl | Design: Newspaperly WordPress Theme