Ghost Solution Suite

 How to install dagent in image without losing Microsoft store and other modern apps

Tom Bosas's profile image
Tom Bosas posted May 09, 2023 08:55 AM

Hello

I have created some Windows 10 images over the past few years. At first, I tried to use audit mode to customize the installation, but Ghost Dagent installed in audit mode does not work properly. Symantec told me that Dagent had to be installed using the built-in administrator account. 

Customizing the image using local user accounts (not audit mode) causes sysprep to fail. I was able to solve that problem using instructions  Symantec/Broadcom support that removed "modern apps" that were causing the issue. Sysprep worked after that, but modern apps like Microsoft Store and Calculator were missing from the image and could not be restored.

This is the current version of the recommended method: Preparing Windows 10 (or Windows 11) to run Sysprep through Ghost Solution Suite Capture Image Task

Is there any way to create an image so that it would include Dagent and modern apps and is also compatible with sysprep? Or do I have to give up either modern apps or Dagent?



Best regards,


Tom

SCOTT READ's profile image
SCOTT READ

WE only pull modern apps that cause this issue.  WE block them from leaking into the base images.   That is a known sysprep issue not a Symantec dagent issue.

Tom Bosas's profile image
Tom Bosas

[fixed a typo after posting: "that is now included" in the last paragraph was supposed to be "that is not included"]



Thank you for your reply Scott. I take it that your images do have a working Microsoft Store app and Windows calculator app? Are any modern apps missing from the deployed sysprepped image?

Is there a list of modern apps that have to be removed for sysprep to work, if Broadcom recommended command Get-AppxPackage -AllUsers | Remove-AppxPackage removes more apps then is strictly necessary?

I have actually been using the scripts from an old version of the guide linked in my original post. I also includes the following command, that is not included in the current version: Get-AppXProvisionedPackage -Online | Remove-AppxProvisionedPackage -Online. Maybe that is causing the issue?


SCOTT READ's profile image
SCOTT READ

WE used the logs in the panther directory to detect and id the modern aps that leak in to break sysprep.

Sysprep fails with Microsoft Store apps - Windows Client | Microsoft Learn

Microsoft flat out tells you to avoid the internet connection.

o resolve this issue, remove the package for the user who's running sysprep, and also remove the provisioning. To do this, follow these steps.

 Note

To prevent Microsoft Store from updating apps, unplug the Internet connection or disable Automatic Updates in Audit mode before you create the image.

  1. Run the Import-Module Appx PowerShell cmdlet.

  2. Run Import-Module Dism.

  3. Run Get-AppxPackage -AllUsers | Where PublisherId -eq 8wekyb3d8bbwe | Format-List -Property PackageFullName,PackageUserInformation.

     Note

    • In the output of this last cmdlet, check the users for whom the package is showing up as Installed. Delete these user accounts from the reference computer, or log on to the computer by using these user accounts. Then, run the cmdlet in step 4 to remove the Appx package.
    • This command lists all packages that were published by Microsoft and installed by any user of that reference computer. Because the computer is to be sysprepped, we assume that these user profiles no longer require the package.
    • If you have manually provisioned apps that belong to other publishers, run the following command to list them:
      Get-AppxPackage -AllUsers | Format-List -Property PackageFullName,PackageUserInformation



Tom Bosas's profile image
Tom Bosas

WE used the logs in the panther directory to detect and id the modern aps that leak in to break sysprep.

I was hoping to avoid the slow trial and error method, as there are several modern apps, but I'll do it.

Microsoft flat out tells you to avoid the internet connection.

I disabled Microsoft Store updates, as mentioned in symantec/broadcom article.

The images you have created have a functional Microsoft Store app in them? 

Daniel McIntyre's profile image
Daniel McIntyre

Hi Tom,

I setup my primary image in Audit mode with modifications to HKLM and HKU (temp loaded as "DefaultModified") keys, a PowerShell script to unprovision UWP apps for all users that aren't necessary, .bat scripts to install needed apps, a scripted install of DAgent and then sysprep.exe /generalize /shutdown /oobe /unattend:filenamehere.xml. The only time I have run into sysprep failing to process /generalize is due to a *device driver-installed* UWP app. Check the end of C:\Windows\System32\Sysprep\Panther\setupact.log to find out which UWP app caused the fault and unprovision it for all users. Store has failed to self-update after deploying the image recently. One incident was self-inflicted; don't stop and disable Storage Service. There is no indication it's linked to Store, but trust me, it is. The other fix is to run C:\Windows\System32\wsreset.exe as a post-deployment job to 'reset' Store.

Happy to help!

Daniel McIntyre