Remove-AppxPackage with -AllUsers errors out

JMerk 0 Reputation points
2023-03-06T22:35:07.7133333+00:00

Hey,

I'm running Windows 11 and using the most up to date version of Powershell 7 and am testing out some scripting to get rid of some preinstalled Microsoft packages. However, when I run this script:

Remove-AppxPackage Microsoft.Print3D_3.3.791.0_x64__8wekyb3d8bbwe -AllUsers

I get the error:

An error occurred because a user was logged off.

Deployment Remove operation with target volume C: on Package Microsoft.Print3D_3.3.791.0_x64__8wekyb3d8bbwe from:

failed with error 0x80073D19. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment

issues.

Any ideas?

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,038 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 43,926 Reputation points
    2023-03-07T15:49:50.7933333+00:00

    Hello,

    This may be due to new feature updates regarding the Microsoft Store.

    Please try first the remove provisioning command line instead of remove package:

    https://learn.microsoft.com/en-us/powershell/module/dism/remove-appxprovisionedpackage?view=windowsserver2022-ps&viewFallbackFrom=win10-ps#description

    If it doesnt work, you may want to try to reset the Microsoft store components with:

    1. Press Windows+R on your keyboard and type "cmd" then press OK
    2. On the command prompt window, type net user administrator /active:yes and press Enter
    3. Perform a reboot, login to your admin account.
    4. Once done, press Windows+R on your keyboard and type "wsreset" > press Enter
    5. Try to open MS Store again
    6. If that didn't work, kindly reset the MS Store app: go to Windows > Settings > Apps > Apps and Features > search for "Microsoft Store" > click on Advanced options > scroll down and click on the "Reset" option.
    7. Once done, try to open the MS Store again.

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments