none
How to delete an app from a deleted user's account RRS feed

  • Question

  • Hello,

    I sideloaded a UWP app onto a Windows 10 machine using account ABC.  The account ABC was deleted from that machine.  I am now unable to install the application on that machine via Visual Studio 2015 remote debugging:

    2>Error : DEP0700 : Registration of the app failed. Another user has already installed an unpackaged version of this app. The current user cannot replace this with a packaged version. The conflicting package is 11e0353e-1c94-4fc4-8e1d-f68e62ebebec and it was published by CN=xxxxxx. (0x80073cf9)

    I'm unable to uninstall the sideloaded application via Administrator PowerShell Remove-AppxPackage because the result says the current user does not have the package installed (of course it doesn't - the user owning the app no longer exists).

    I'm unable to re-create the account ABC.

    How do I delete this app?

    Thanks.

    Thursday, April 14, 2016 1:57 PM

Answers

  • Hello

    Here is how I do!

    ATTENTION!

    NOTE THAT THIS METHOD IS BASED ON ABOUT TO DEMOLISH WINDOWS BUILT IN DATABASE FILES!

    After hours , and days, trying to figure out the solution (registry settings, manual uninstalls, dozens of other attempts) , finally this method works.

    Situation:

    Windows 10  Professional build 1709 . We cannot run sysprep because sysprep was not able to validate your windows installation

    Caused by Windows store App like candy crush soda saga installed automatically for a user, which has been deleted from the system.

    Windows cannot handle the situation right now. Hope there will be some quickfix.

    There is no official Microsoft workaround for that. Or maybe I was not able to find it.

    So, I decided to reset (actually delete, and let it rebuild) the Windows Appstore database.
    I put the system offline first.

    It is located at

    C:\ProgramData\Microsoft\Windows\AppRepository

    The two files are:

    StateRepository-Deployment.srd

    StateRepository-Machine.srd

    I rename them to originalname.srd.bak

    Sometimes I need to stop StateRepository service (as administrator of course) 2 or 3 times before is releases the files (F5 for refresh).

    After that, I run immediately sysprep, and it runs flawless. AND system rebuilds the whole AppRepository directory. Even the .bak files disappear

    These files are protected, and can only be modified by SYSTEM.

    I will not write down the workaround step by step.  If you are an IT specialist, you already know how to use psexec, or DARTS, or any live OS to get through this.

    So Once again:

    THIS METHOD IS BASED ON ABOUT TO DEMOLISH WINDOWS BUILT IN DATABASE FILES! MAKE THIS ON YOUR OWN RISK!

    Cheers!

    Greg

    Tuesday, June 5, 2018 4:40 PM

All replies

  • Does the all users parameter of Get-AppxPackage show the app?

    Get-AppxPackage -AllUsers | Select-Object Name

    If that does try piping to remote appx

    Get-AppxPackage -AllUsers -Name king.com.CandyCrushSodaSaga | Remove-AppxPackage -Verbose

    Thursday, April 14, 2016 6:06 PM
  • Hi MichaelTactual,

    Have you restarted the machine?

    Please try the following stepst to list and remove the packages and the provisioned packages.
    1.Run the Import-Module Appx PowerShell cmdlet.
    2.Run Import-Module Dism.
    3.Run Get-AppxPackage -AllUser | Where PublisherId -eq 8wekyb3d8bbwe | Format-List -Property PackageFullName,PackageUserInformation.

    Notes
    •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 -AllUser | Format-List -Property PackageFullName,PackageUserInformation

    4.Run Remove-AppxPackage -Package <packagefullname>.
    5.Remove the provisioning by running the following cmdlet:

    Remove-AppxProvisionedPackage -Online -PackageName <packagefullname>
    If you try to recover from an update issue, you can reprovision the app after you follow these steps.

    Best regards


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Friday, April 15, 2016 7:24 AM
    Moderator
  • I have similar issue. I've installed application for one user. Than I deleted this user (but i forgot to uninstall application) When I try to install application from new user I have the issue. I do not know how to delete record that first user install it.

    I was trying your advice but I have error when I try to remove app. The output is following

    Remove-AppxPackage : Сбой развертывания с HRESULT: 0x80073CF1, Пакет не найден. (Исключение из HRESULT: 0x80073CF1)
    ПРИМЕЧАНИЕ. Чтобы получить дополнительные сведения, найдите [ActivityId] fa9d923e-b672-0006-349b-9dfa72b6d101 в журнале событий или введите в командной строке Get-AppxLog -ActivityID fa9d923e-b672
    -0006-349b-9dfa72b6d101.
    строка:1 знак:1
    + Remove-AppxPackage -Package 0EB8BD08.NeedAHero_1.5.667.0_x64__erk4rrw ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (0EB8BD08.NeedAH...__erk4rrwmt7jyt:String) [Remove-AppxPackage], PSInvalidOperationException
        + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

    Wednesday, May 25, 2016 11:42 AM
  • Did you ever find the right answer to your question? I am faced with the same issue and is preventing me from running sysprep.

    Thank you

    Thursday, May 18, 2017 12:45 AM
  • Ditto this.  I can't sysprep a machine because "Microsoft.Messaging" is installed for an account that was used during OOBE, but was then soon deleted. Any help would be fantastic. What I've tried so far with NO luck on a test machine:

    - searched the orphaned SID in the registry and deleted all references (the SID shows up in "get-appxPackage -allUsers")

    - searched that same SID in the file system and removed all referencing file in "AppRepository" and "WindowsApps"

    - ran numerous PowerShell commands such as remove-appxPackage, remove-appxProvisionedPackage, with "-allUsers" and without

    Does anyone know what "get-appxPackage -allUsers" queries? An editable database?

    Thanks for any insight.

    Thursday, June 1, 2017 6:22 PM
  • Another user, Alex Soa, has replied to a thread you have subscribed to in the Windows 10 General Forum.

    If you are the original poster, please remember to click "Mark as Answer" on the post if your question was answered appropriately. This includes any reply that was post by yourself or others. In doing so, it will benefit all community members who are facing similar issues. Your contribution is highly appreciated. If you are not the original poster of this thread, please disregard this message.

    Thread Title How to delete an app from a deleted user's account
    Started by: MichaelTactual

    Reply:

    I had this issue =(. I would no be able to remove a package from a user that was deleted.

    Apparently the appxpackage database is saved in this file: C:\ProgramData\Microsoft\Windows\AppRepositoryStateRepository-Machine.srd

    I moved all contents from below folders to a backup folder except the ones related to Windows Store. To do so I got the ownership of the folders and subfolders and granted permissions to my local account. 

    C:\ProgramData\Microsoft\Windows\AppRepository

    C:\Program Files\WindowsApps\

    You will have to stop below services in order to be able to move the files (The SO tells you which services you need to stop but I will list anyway):

    AppX Deployment Service (AppXSVC) 

    StateRepository

    Tile Data model server

    Once I moved those files I could not query the appxpacakges using get-appxpackage anymore.

    To rebuild the store database and file structure under "C:\ProgramData\Microsoft\Windows\AppRepository" I ran WSReset.exe from c:\windows\system32 and restarted the PC. It seemed 

    After that get-appxpackage -allusers would not list any appx and I could run sysprep on the computer.

    Make it sure that you configured your Windows Store not to download the apps automatically or this can break your image next time you need to edit it.

    See if that helps,

    Best regards,

    Alex

    • Proposed as answer by malcolm061990 Wednesday, October 25, 2017 12:16 PM
    Monday, June 19, 2017 12:41 PM
  • DITTO.  Sysprep is failing because there's AppX packages installed for a user that doesn't f***ing exist!!!!!!

    MICROSOFT—FIX THIS SH*T.
    Tuesday, July 11, 2017 10:09 PM
  • I can't even stop the services. And when i changed the permission and try to delete it says i must obtain permission from... MYSELF. It's like they have so much going on here they can't keep up with themselves.
    Thursday, July 13, 2017 6:56 PM
  • I agree, they are trying to please the kiddo's vs business environments and its creating a nightmare scenario for the real world. MS please do us all a big favor and can the store, this isnt apple.

    Doug A

    Tuesday, May 22, 2018 6:59 PM
  • Hello

    Here is how I do!

    ATTENTION!

    NOTE THAT THIS METHOD IS BASED ON ABOUT TO DEMOLISH WINDOWS BUILT IN DATABASE FILES!

    After hours , and days, trying to figure out the solution (registry settings, manual uninstalls, dozens of other attempts) , finally this method works.

    Situation:

    Windows 10  Professional build 1709 . We cannot run sysprep because sysprep was not able to validate your windows installation

    Caused by Windows store App like candy crush soda saga installed automatically for a user, which has been deleted from the system.

    Windows cannot handle the situation right now. Hope there will be some quickfix.

    There is no official Microsoft workaround for that. Or maybe I was not able to find it.

    So, I decided to reset (actually delete, and let it rebuild) the Windows Appstore database.
    I put the system offline first.

    It is located at

    C:\ProgramData\Microsoft\Windows\AppRepository

    The two files are:

    StateRepository-Deployment.srd

    StateRepository-Machine.srd

    I rename them to originalname.srd.bak

    Sometimes I need to stop StateRepository service (as administrator of course) 2 or 3 times before is releases the files (F5 for refresh).

    After that, I run immediately sysprep, and it runs flawless. AND system rebuilds the whole AppRepository directory. Even the .bak files disappear

    These files are protected, and can only be modified by SYSTEM.

    I will not write down the workaround step by step.  If you are an IT specialist, you already know how to use psexec, or DARTS, or any live OS to get through this.

    So Once again:

    THIS METHOD IS BASED ON ABOUT TO DEMOLISH WINDOWS BUILT IN DATABASE FILES! MAKE THIS ON YOUR OWN RISK!

    Cheers!

    Greg

    Tuesday, June 5, 2018 4:40 PM
  • Thanks oldboyscout , That fix worked for me.
    • Edited by keilum Thursday, June 7, 2018 11:18 AM
    Thursday, June 7, 2018 11:17 AM
  • seem problem , do you solve it?  598821125@qq.com
    Thursday, July 19, 2018 11:36 AM
  • seem problem , do you solve it?  598821125@qq.com
    Thursday, July 19, 2018 11:37 AM
  • seem problem , do you solve it?  598821125@qq.com
    Thursday, July 19, 2018 11:37 AM
  • This is the best solution.  Thank You.
    Thursday, November 29, 2018 1:48 PM
  • thank u .
    Tuesday, February 19, 2019 9:24 PM
  • If you put it offline first, why is the staterepository service complaining? That doesn't add up, please clarify. Does this work if you boot into winPE and rename and then boot into the OS and sysprep?

    Thanks

    Friday, April 19, 2019 1:58 PM
  • This solution works well.  No need to run Get-Appxpackage | Remove-appxpackage command.  Thank You...
    Sunday, May 19, 2019 11:18 AM
  • Just wanted to add to this solution that if you need to do a sysprep later on, you can do it like this:

    1. Make yourself Owner of the folder C:\ProgramData\Microsoft\Windows\AppRepository and check "Subfolders..." as well

    2. Give yourself Full Control on these two files:

    StateRepository-Deployment.srd

    StateRepository-Machine.srd

    3. When you have stopped the StateRepository service just delete the 2 mentioned files (rename not necessary).

    4. Re-enable the service and the files will be re-created. From now on Sysprep works like intended and you can do it at any one point.

    Wednesday, August 21, 2019 1:19 PM