1

I'm trying to restore some of the deproviosioned, during OS installation, apps from SystemApps:

Microsoft.AAD.BrokerPlugin
Microsoft.BioEnrollment
Microsoft.ECApp
Microsoft.LockApp
Microsoft.MicrosoftEdge
Microsoft.MicrosoftEdgeDevToolsClient
Microsoft.Windows.AddSuggestedFoldersToLibarayDialog
Microsoft.Windows.CallingShellApp
Microsoft.Windows.CapturePicker
Microsoft.Windows.ContentDeliveryManager
Microsoft.Windows.FilePicker
Microsoft.Windows.NarratorQuickStart
Microsoft.Windows.XGpuEjectDialog
Microsoft.XboxGameCallableUI
Microsoft.Windows.SecHealthUI
NcsiUwpApp
MicrosoftWindows.UndockedDevKit
Microsoft.Windows.ParentalControls
Microsoft.Windows.PeopleExperienceHost

Note that those are not deleted, just deprovisioned via OO. The issue is:

Add-AppxPackage -DisableDevelopmentMode -Register "C:\Windows\SystemApps\Microsoft.Windows.PeopleExperienceHost_cw5n1h2txyewy\AppxManifest.xml"
Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF9, Install failed. Please contact your software vendor. (Exception from HRESULT: 0x80073CF9)       Rejecting a request to register from AppxManifest.xml because the manifest is not in the package root.

Add-AppxPackage -Register "C:\Windows\SystemApps\Microsoft.Windows.PeopleExperienceHost_cw5n1h2txyewy\AppxManifest.xml"
Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF6, Package could not be registered.
error 0x800701C5: While processing the request, the system failed to register the windows.capability extension due to the following error: The requested
capability can not be authorized for this application.

I remember there was a way to somehow re-provision them and force Windows to commit to provisioning but I can't find it anywhere.

Digika
  • 11
  • 3
  • [Optimized Offline](https://github.com/gdeliana/Optimize-Offline) indicates the applications are deprovisioned and removed the system. The error you are getting suggests the package, has been removed from the WinSxS directory, which means you will have to use an ISO to reinstall the package. *My suggestion, is to simply perform an in-place repair install of the same version of Windows you are currently using.* – Ramhound Feb 27 '23 at 22:24
  • You won't be able to reinstall Legacy Microsoft Edge. It was removed from WinSxS over 2 years ago. – Ramhound Feb 27 '23 at 22:31
  • This whole question exist because I dont want to do any kind of reinstall. The system customized way too much – Digika Mar 01 '23 at 09:29
  • Even if you were to reinstall Windows you wouldn’t be able to keep Legacy Microsoft Edge. It would immediately be removed by Windows Update. I suspect you will have to use an ISO, that does have the package, in order to install the package since the tool you used permanently removed them from your Windows image. – Ramhound Mar 01 '23 at 12:53
  • I think you are confused, I dont give a single about IE/Edge. My issue is deeper, I can't use login in MS Store/Xbox app because something is amiss, it wants some dependency but I have no idea which, it does not log it into Windows journal. – Digika Mar 02 '23 at 15:14
  • One of the applications you wanted to restore was `Microsoft.MicrosoftEdge` which is Legacy Microsoft Edge not the Chromium based Microsoft Edge. Wish you asked about the Microsoft Store problem instead of trying to restore permanently deleted system applications. – Ramhound Mar 02 '23 at 15:19

1 Answers1

1

You could use the PowerShell scripts found in the article Reprovision Windows 10 Apps… Wait, What?

The article says this :

The gist of it is, when an app is deprovisioned a registry key will be made. If that registry key is present then the app will not be reinstalled on any Windows 10 Feature Update that is 1803 or above.

The article contains two PowerShell functions for listing deprovisioned apps and reprovisioning apps. Once these functions are created, this command will do the job:

Get-DeprovisionedAppX -Filter 'Store' | Reprovision-AppX

In case the article will disappear in the future, here are the two functions:

Get-DeprovisionedAppX

function Get-DeprovisionedAppX {
    #
    .SYNOPSIS
        Returns an array of apps that are deprovisioned
    .DESCRIPTION
        This function returns an array of all the apps that are deprovisioned on the local computer.
        Deprovisioned apps will show up in the registry if they were removed while Windows was offline, or
        with the PowerShell cmdlets for removing AppX Packages.
    .PARAMETER Filter
        Option filter that will be ran through as a '-match' so that regex can be used
        Accepts an array of strings, which can be a regex string if you wish
    .EXAMPLE
        PS C:\> Get-DeprovisionedAppX
        Return all deprovisioned apps on the local computers
    .EXAMPLE
        PS C:\> Get-DeprovisionedAppX -Filter Store
        Return all deprovisioned apps on the local computers that match the filter 'Store'
    #>
    param (
        [parameter(Mandatory = $false)]
        [string[]]$Filter
    )
    begin {
        $DeprovisionRoot = "registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned"
        $AllDeprovisionedApps = Get-ChildItem -Path $DeprovisionRoot | Select-Object -Property @{ Name = 'DeprovisionedApp'; Expression = { $_.PSChildName } }
        if ($null -eq $AllDeprovisionedApps) {
            Write-Warning "There are no deprovisioned apps"
        }
    }
    process {
        switch ($PSBoundParameters.ContainsKey('Filter')) {
            $true {
                foreach ($SearchString in $Filter) {
                    switch -regex ($AllDeprovisionedApps.DeprovisionedApp) {
                        $SearchString {
                            [PSCustomObject]@{ 
                                'DeprovisionedApp' = $PSItem
                            }
                        }
                        default {
                            Write-Verbose "$PSItem does not match the filter `'$SearchString`""
                        }
                    }
                }
            }
            $false {
                Write-Output $AllDeprovisionedApps
            }
        }
    }
}

Reprovision-AppX

function Reprovision-AppX {
    #
    .SYNOPSIS
        'Reprovision' apps by removing the registry key that prevents app reinstall
    .DESCRIPTION
        Starting in Windows 10 1803, a registry key is set for every deprovisioned app. As long as this registry key
        is in place, a deprovisioned application will not be reinstalled during a feature update. By removing these
        registry keys, we can ensure that deprovisioned apps, such as the windows store are able to be reinstalled.
    .PARAMETER DeprovisionedApp
        The full name of the app to reprovision, as it appears in the registry. You can easily get this name using
        the Get-DeprovisionedApp function. 
    .EXAMPLE
        PS C:\> Reprovision-AppX -DeprovisionedApp 'Microsoft.WindowsAlarms_8wekyb3d8bbwe'
        Removes the registry key for the deprovisioned WindowsAlarms app. The app will return after the next
        feature update.
    .INPUTS
        [string[]]
    .NOTES
        You must provide the exact name of the app as it appears in the registry. This is the full app 'name' - It is 
        recommended to first use the Get-DeprovisionApp function to find apps that can be reprovisioned.
    #>
    [CmdletBinding(SupportsShouldProcess)]
    param(
        [parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
        [string[]]$DeprovisionedApp
    )
    begin {
        $DeprovisionRoot = "registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned"
        $AllDeprovisionedApps = Get-ChildItem -Path $DeprovisionRoot
        if ($null -eq $AllDeprovisionedApps) {
            Write-Warning "There are no deprovisioned apps"
        }
    }
    process {
        foreach ($App in $DeprovisionedApp) {
            $DeprovisionedAppPath = Join-Path -Path $DeprovisionRoot -ChildPath $App
            if ($PSCmdlet.ShouldProcess($App, "Reprovision-App")) {
                $AppPath = Resolve-Path -Path $DeprovisionedAppPath -ErrorAction Ignore
                if ($null -ne $AppPath) {
                    Remove-Item -Path $AppPath.Path -Force
                }
                else {
                    Write-Warning "App $App was not found to be deprovisioned"
                }
            }
        }
    }
}
harrymc
  • 455,459
  • 31
  • 526
  • 924
  • Sadly, that is not applicable to SystemApps. These handled differently than `default packaged appsx`. I also cannot get any Feature Updates n LTSC, but even if I wsn't on that edition there are no feature updates for mainline Windows in sight – Digika Feb 27 '23 at 17:09
  • You will need then to get them from a Windows ISO. If you can find them in Windows Store, reinstall the apps from there ([link](https://www.vacuumbreather.com/index.php/blog/item/85-restore-a-deprovisioned-windows-10-in-box-app)). – harrymc Feb 27 '23 at 17:12
  • They dont exist in appx/appxbundle/msixbundle format at all, even in WIM sources – Digika Feb 27 '23 at 20:10
  • Tough case. This [link](http://www.edugeek.net/forums/windows-10/178561-reinstalling-previously-deleted-provisioned-app.html) seems promising, but requires a donor machine. If it works I'll add it to my answer. – harrymc Feb 27 '23 at 20:34
  • It is even tougher than you thinks, the link bears no relevance as it talks about user apps, not system ones. And if you read op you can see I've tried re-registering but you can't just do that with systemapps – Digika Feb 27 '23 at 22:14
  • What happens if you try this last mehod as Admin, or as System using [psexec](https://learn.microsoft.com/en-us/sysinternals/downloads/psexec)? Read [this answer](https://superuser.com/a/1365110/8672) before taking ownership of WindowsApps. – harrymc Feb 28 '23 at 08:50
  • I've tried with TrustedInstaller rights. – Digika Mar 01 '23 at 09:28
  • And it still didn't work? – harrymc Mar 01 '23 at 09:31
  • If it did, question would be closed. – Digika Mar 02 '23 at 15:13
  • @Digika - Questions are not closed because an answer is accepted or suggested resolution "worked". – Ramhound Mar 02 '23 at 15:18